feat: add compression and digest support with database schema updates
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
9b61a37036
commit
bbdfe19836
104
src/tests.rs
104
src/tests.rs
@@ -118,7 +118,13 @@ mod tests {
|
||||
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);
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
|
||||
let cmd = format!("{} -g 1", keep_cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
@@ -129,7 +135,13 @@ mod tests {
|
||||
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);
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
|
||||
let cmd = format!("{} 1", keep_cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
@@ -140,7 +152,13 @@ mod tests {
|
||||
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);
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get", keep_cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
@@ -151,7 +169,13 @@ mod tests {
|
||||
output.status
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(output_str.contains(INPUT_B), "Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"", cmd, output_str, INPUT_B);
|
||||
assert!(
|
||||
output_str.contains(INPUT_B),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_B
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get tag_a", keep_cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
@@ -162,7 +186,13 @@ mod tests {
|
||||
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);
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get tag_b", keep_cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
@@ -173,7 +203,13 @@ mod tests {
|
||||
output.status
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(output_str.contains(INPUT_B), "Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"", cmd, output_str, INPUT_B);
|
||||
assert!(
|
||||
output_str.contains(INPUT_B),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_B
|
||||
);
|
||||
|
||||
let cmd = format!("{} --get tag", keep_cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
@@ -184,7 +220,13 @@ mod tests {
|
||||
output.status
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(output_str.contains(INPUT_B), "Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"", cmd, output_str, INPUT_B);
|
||||
assert!(
|
||||
output_str.contains(INPUT_B),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_B
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -292,9 +334,21 @@ mod tests {
|
||||
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);
|
||||
assert!(
|
||||
output_str.contains(INPUT_A),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_A
|
||||
);
|
||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
assert!(output_str.contains(INPUT_B), "Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"", cmd, output_str, INPUT_B);
|
||||
assert!(
|
||||
output_str.contains(INPUT_B),
|
||||
"Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"",
|
||||
cmd,
|
||||
output_str,
|
||||
INPUT_B
|
||||
);
|
||||
|
||||
let cmd = format!("{} --diff tag_a tag_b", keep_cmd);
|
||||
let output = run_sh(cmd.as_str());
|
||||
@@ -373,7 +427,13 @@ mod tests {
|
||||
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);
|
||||
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);
|
||||
@@ -396,7 +456,13 @@ mod tests {
|
||||
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);
|
||||
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);
|
||||
@@ -419,7 +485,13 @@ mod tests {
|
||||
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);
|
||||
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);
|
||||
@@ -442,7 +514,13 @@ mod tests {
|
||||
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);
|
||||
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