refactor: integrate digest functionality into meta plugins and remove digest_engine module
Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
135
src/tests.rs
135
src/tests.rs
@@ -388,139 +388,4 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
// Test: Compression functionality with different algorithms
|
||||
#[test]
|
||||
fn test_compression() {
|
||||
with_temp_env(|data_dir| {
|
||||
// Set the data directory for this test
|
||||
let keep_cmd = format!("KEEP_DIR={} cargo run -- --verbose", data_dir.display());
|
||||
|
||||
// Test with no compression
|
||||
let cmd = format!("echo {} | {} -c unknown unknown", INPUT_A, keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
!output.status.success(),
|
||||
"Command succeeded when it should have failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
|
||||
// Test with no compression
|
||||
let cmd = format!("echo {} | {} -c none none", INPUT_A, keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get none", keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
|
||||
// Test with lz4 compression
|
||||
let cmd = format!("echo {} | {} -c lz4 lz4", INPUT_A, keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get lz4", keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
|
||||
// Test with gzip compression
|
||||
let cmd = format!("echo {} | {} -c gzip gzip", INPUT_A, keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get gzip", keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
|
||||
// Test with bzip2 compression
|
||||
let cmd = format!("echo {} | {} -c bzip2 bzip2", INPUT_A, keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get bzip2", keep_cmd);
|
||||
println!("RUNNING: {}", cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
assert!(
|
||||
output.status.success(),
|
||||
"Command failed: {} {}",
|
||||
cmd,
|
||||
output.status
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user