1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-10 01:56:45 +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

@ -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]
@ -92,14 +104,14 @@ fn test_runparams_condition_helpers() {
#[test]
fn test_manual_condition_files() {
// Test our new testdata files to make sure they work properly
// Test environment conditions file
let result = testscript::run("testdata")
.condition("net", true) // Force network to true for testing
.auto_detect_programs(&["echo", "mkdir", "ls"])
.execute();
// Note: This might fail if some testdata files have issues,
// Note: This might fail if some testdata files have issues,
// but our specific files should work
if let Err(e) = result {
println!("Some testdata files failed (expected): {}", e);
@ -131,8 +143,12 @@ 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");
}
}