1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-18 14:46:25 +00:00

improve error messages with context (#13)

Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
Jason Hall 2025-09-26 19:55:13 -04:00 committed by GitHub
parent 38bef8a370
commit 3a8e953f70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 156 additions and 3 deletions

View file

@ -138,7 +138,12 @@ exec echo "This should not run""#;
let result = run_test(&script_path);
assert!(result.is_err(), "Skip test should have failed");
assert!(result.unwrap_err().to_string().contains("SKIP"));
let error_msg = result.unwrap_err().to_string();
println!("Skip error message: {}", error_msg);
// The skip command should create a contextual error showing the skip line
assert!(error_msg.contains("skip_test.txt"));
assert!(error_msg.contains("skip \"This test should be skipped\""));
}
#[test]