1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-21 22:39:49 +00:00

Fix code formatting issues that caused CI failure

Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-09-27 02:25:43 +00:00
parent 7e37906109
commit d01b8865de
3 changed files with 33 additions and 15 deletions

View file

@ -88,7 +88,8 @@ impl RunParams {
/// Automatically detect network availability and set the 'net' condition
pub fn auto_detect_network(mut self) -> Self {
self.conditions.insert("net".to_string(), Self::check_network_available());
self.conditions
.insert("net".to_string(), Self::check_network_available());
self
}
@ -96,7 +97,8 @@ impl RunParams {
pub fn auto_detect_programs(mut self, programs: &[&str]) -> Self {
for program in programs {
let condition_name = format!("exec:{}", program);
self.conditions.insert(condition_name, Self::program_exists(program));
self.conditions
.insert(condition_name, Self::program_exists(program));
}
self
}

View file

@ -26,7 +26,11 @@ stdout "negated env condition works"
fs::write(testdata_dir.join("env_test.txt"), test_content).unwrap();
let result = testscript::run(testdata_dir.to_string_lossy()).execute();
assert!(result.is_ok(), "Environment condition test failed: {:?}", result);
assert!(
result.is_ok(),
"Environment condition test failed: {:?}",
result
);
// Clean up
std::env::remove_var("TEST_CONDITION");
@ -52,7 +56,11 @@ stdout "test completed"
let result = testscript::run(testdata_dir.to_string_lossy())
.auto_detect_network()
.execute();
assert!(result.is_ok(), "Network condition test failed: {:?}", result);
assert!(
result.is_ok(),
"Network condition test failed: {:?}",
result
);
}
#[test]
@ -74,7 +82,11 @@ stdout "nonexistent program not found"
let result = testscript::run(testdata_dir.to_string_lossy())
.auto_detect_programs(&["echo", "nonexistent_program_xyz"])
.execute();
assert!(result.is_ok(), "Program detection test failed: {:?}", result);
assert!(
result.is_ok(),
"Program detection test failed: {:?}",
result
);
}
#[test]
@ -131,7 +143,11 @@ stdout "env var is set"
.auto_detect_network()
.auto_detect_programs(&["echo"])
.execute();
assert!(result.is_ok(), "Combined condition test failed: {:?}", result);
assert!(
result.is_ok(),
"Combined condition test failed: {:?}",
result
);
// Clean up
std::env::remove_var("COMBINED_TEST");