refactor: use input_a and input_b in test assertions
This commit is contained in:
18
src/tests.rs
18
src/tests.rs
@@ -108,7 +108,7 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content A"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content A\"", cmd, output_str);
|
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", env);
|
let cmd = format!("{} -g 1", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
@@ -119,7 +119,7 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content A"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content A\"", cmd, output_str);
|
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", env);
|
let cmd = format!("{} 1", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
@@ -130,7 +130,7 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content A"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content A\"", cmd, output_str);
|
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", env);
|
let cmd = format!("{} --get", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
@@ -141,7 +141,7 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content B"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content B\"", cmd, output_str);
|
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", env);
|
let cmd = format!("{} --get tag_a", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
@@ -152,7 +152,7 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content A"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content A\"", cmd, output_str);
|
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", env);
|
let cmd = format!("{} --get tag_b", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
@@ -163,7 +163,7 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content B"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content B\"", cmd, output_str);
|
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", env);
|
let cmd = format!("{} --get tag", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
@@ -174,7 +174,7 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content B"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content B\"", cmd, output_str);
|
assert!(output_str.contains(input_b), "Command output does not contain expected string. Command: {} Output: {} Expected: \"{}\"", cmd, output_str, input_b);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,9 +282,9 @@ mod tests {
|
|||||||
output.status
|
output.status
|
||||||
);
|
);
|
||||||
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content A"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content A\"", cmd, output_str);
|
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();
|
let output_str = String::from_utf8_lossy(&output.stdout).to_string();
|
||||||
assert!(output_str.contains("test content B"), "Command output does not contain expected string. Command: {} Output: {} Expected: \"test content B\"", cmd, output_str);
|
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", env);
|
let cmd = format!("{} --diff tag_a tag_b", env);
|
||||||
let output = run_sh(cmd.as_str());
|
let output = run_sh(cmd.as_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user