fix: resolve compilation errors in tests by fixing type mismatches and imports
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -12,7 +12,7 @@ use tower_http::cors::CorsLayer;
|
|||||||
use tower::ServiceBuilder;
|
use tower::ServiceBuilder;
|
||||||
use tower_http::trace::TraceLayer;
|
use tower_http::trace::TraceLayer;
|
||||||
|
|
||||||
mod common;
|
pub mod common;
|
||||||
mod api;
|
mod api;
|
||||||
mod pages;
|
mod pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::compression_engine::program::CompressionEngineProgram;
|
use crate::compression_engine::program::CompressionEngineProgram;
|
||||||
|
use crate::compression_engine::CompressionEngine;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_compression_engine_program_creation() {
|
fn test_compression_engine_program_creation() {
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ mod tests {
|
|||||||
|
|
||||||
// Try to get meta for non-existent item
|
// Try to get meta for non-existent item
|
||||||
let item = crate::db::Item {
|
let item = crate::db::Item {
|
||||||
id: 999, // Non-existent item
|
id: Some(999), // Non-existent item
|
||||||
ts: chrono::Utc::now(),
|
ts: chrono::Utc::now(),
|
||||||
size: 0,
|
size: Some(0),
|
||||||
compression: crate::compression_engine::CompressionType::None,
|
compression: crate::compression_engine::CompressionType::None.to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let metas = db::get_item_meta(&conn, &item);
|
let metas = db::get_item_meta(&conn, &item);
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ mod tests {
|
|||||||
|
|
||||||
// Try to delete tags for non-existent item
|
// Try to delete tags for non-existent item
|
||||||
let item = crate::db::Item {
|
let item = crate::db::Item {
|
||||||
id: 999, // Non-existent item
|
id: Some(999), // Non-existent item
|
||||||
ts: chrono::Utc::now(),
|
ts: chrono::Utc::now(),
|
||||||
size: 0,
|
size: Some(0),
|
||||||
compression: crate::compression_engine::CompressionType::None,
|
compression: crate::compression_engine::CompressionType::None.to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let delete_result = db::delete_item_tags(&conn, item);
|
let delete_result = db::delete_item_tags(&conn, item);
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_digest_sha256_meta_plugin() {
|
fn test_digest_sha256_meta_plugin() {
|
||||||
let mut plugin = DigestSha256MetaPlugin::new("test_digest".to_string());
|
let mut plugin = DigestSha256MetaPlugin::new();
|
||||||
|
|
||||||
assert_eq!(plugin.meta_name(), "test_digest");
|
assert_eq!(plugin.meta_name(), "digest_sha256");
|
||||||
assert!(plugin.is_internal());
|
assert!(plugin.is_internal());
|
||||||
|
|
||||||
// Creating a writer should work
|
// Creating a writer should work
|
||||||
@@ -23,9 +23,9 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_read_time_meta_plugin() {
|
fn test_read_time_meta_plugin() {
|
||||||
let mut plugin = ReadTimeMetaPlugin::new("read_time_test".to_string());
|
let mut plugin = ReadTimeMetaPlugin::new();
|
||||||
|
|
||||||
assert_eq!(plugin.meta_name(), "read_time_test");
|
assert_eq!(plugin.meta_name(), "read_time");
|
||||||
assert!(plugin.is_internal());
|
assert!(plugin.is_internal());
|
||||||
|
|
||||||
// Creating a writer should work
|
// Creating a writer should work
|
||||||
@@ -35,9 +35,9 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_read_rate_meta_plugin() {
|
fn test_read_rate_meta_plugin() {
|
||||||
let mut plugin = ReadRateMetaPlugin::new("read_rate_test".to_string());
|
let mut plugin = ReadRateMetaPlugin::new();
|
||||||
|
|
||||||
assert_eq!(plugin.meta_name(), "read_rate_test");
|
assert_eq!(plugin.meta_name(), "read_rate");
|
||||||
assert!(plugin.is_internal());
|
assert!(plugin.is_internal());
|
||||||
|
|
||||||
// Creating a writer should work
|
// Creating a writer should work
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_meta_plugin_program_creation() {
|
fn test_meta_plugin_program_creation() {
|
||||||
let plugin = MetaPluginProgram::new(
|
let plugin = MetaPluginProgram::new(
|
||||||
"echo".to_string(),
|
"echo",
|
||||||
vec!["test".to_string()],
|
vec!["test"],
|
||||||
"test_plugin".to_string(),
|
"test_plugin".to_string(),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
@@ -20,8 +20,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_meta_plugin_program_create_writer() {
|
fn test_meta_plugin_program_create_writer() {
|
||||||
let plugin = MetaPluginProgram::new(
|
let plugin = MetaPluginProgram::new(
|
||||||
"cat".to_string(),
|
"cat",
|
||||||
vec![].to_vec(),
|
vec![],
|
||||||
"cat_plugin".to_string(),
|
"cat_plugin".to_string(),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
@@ -36,8 +36,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_meta_plugin_program_unsupported() {
|
fn test_meta_plugin_program_unsupported() {
|
||||||
let plugin = MetaPluginProgram::new(
|
let plugin = MetaPluginProgram::new(
|
||||||
"nonexistent_program_xyz".to_string(),
|
"nonexistent_program_xyz",
|
||||||
vec![].to_vec(),
|
vec![],
|
||||||
"bad_plugin".to_string(),
|
"bad_plugin".to_string(),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user