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:
@@ -1,6 +1,7 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::compression_engine::program::CompressionEngineProgram;
|
||||
use crate::compression_engine::CompressionEngine;
|
||||
|
||||
#[test]
|
||||
fn test_compression_engine_program_creation() {
|
||||
|
||||
@@ -26,10 +26,10 @@ mod tests {
|
||||
|
||||
// Try to get meta for non-existent item
|
||||
let item = crate::db::Item {
|
||||
id: 999, // Non-existent item
|
||||
id: Some(999), // Non-existent item
|
||||
ts: chrono::Utc::now(),
|
||||
size: 0,
|
||||
compression: crate::compression_engine::CompressionType::None,
|
||||
size: Some(0),
|
||||
compression: crate::compression_engine::CompressionType::None.to_string(),
|
||||
};
|
||||
|
||||
let metas = db::get_item_meta(&conn, &item);
|
||||
|
||||
@@ -35,10 +35,10 @@ mod tests {
|
||||
|
||||
// Try to delete tags for non-existent item
|
||||
let item = crate::db::Item {
|
||||
id: 999, // Non-existent item
|
||||
id: Some(999), // Non-existent item
|
||||
ts: chrono::Utc::now(),
|
||||
size: 0,
|
||||
compression: crate::compression_engine::CompressionType::None,
|
||||
size: Some(0),
|
||||
compression: crate::compression_engine::CompressionType::None.to_string(),
|
||||
};
|
||||
|
||||
let delete_result = db::delete_item_tags(&conn, item);
|
||||
|
||||
@@ -6,9 +6,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
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());
|
||||
|
||||
// Creating a writer should work
|
||||
@@ -23,9 +23,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
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());
|
||||
|
||||
// Creating a writer should work
|
||||
@@ -35,9 +35,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
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());
|
||||
|
||||
// Creating a writer should work
|
||||
|
||||
@@ -6,8 +6,8 @@ mod tests {
|
||||
#[test]
|
||||
fn test_meta_plugin_program_creation() {
|
||||
let plugin = MetaPluginProgram::new(
|
||||
"echo".to_string(),
|
||||
vec!["test".to_string()],
|
||||
"echo",
|
||||
vec!["test"],
|
||||
"test_plugin".to_string(),
|
||||
false,
|
||||
);
|
||||
@@ -20,8 +20,8 @@ mod tests {
|
||||
#[test]
|
||||
fn test_meta_plugin_program_create_writer() {
|
||||
let plugin = MetaPluginProgram::new(
|
||||
"cat".to_string(),
|
||||
vec![].to_vec(),
|
||||
"cat",
|
||||
vec![],
|
||||
"cat_plugin".to_string(),
|
||||
false,
|
||||
);
|
||||
@@ -36,8 +36,8 @@ mod tests {
|
||||
#[test]
|
||||
fn test_meta_plugin_program_unsupported() {
|
||||
let plugin = MetaPluginProgram::new(
|
||||
"nonexistent_program_xyz".to_string(),
|
||||
vec![].to_vec(),
|
||||
"nonexistent_program_xyz",
|
||||
vec![],
|
||||
"bad_plugin".to_string(),
|
||||
false,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user