From 994ff9da550634382df96084988633c8fa65d2c1 Mon Sep 17 00:00:00 2001 From: Surma Date: Sun, 8 Nov 2026 00:55:29 +0000 Subject: [PATCH] tests: show CLI output when the shell corpus exits incorrectly --- host/tests/it/process.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/host/tests/it/process.rs b/host/tests/it/process.rs index 44f9af5..23dac35 100644 --- a/host/tests/it/process.rs +++ b/host/tests/it/process.rs @@ -21,7 +21,10 @@ fn world_copies_programs_and_nested_source_only_once() -> anyhow::Result<()> { b"ref: refs/heads/main\n", )?; std::fs::write(bundle.join("src/sausage/README.md"), b"source")?; - for (name, target) in [("readme-link", "README.md"), ("broken-link", "missing.wasm")] { + for (name, target) in [ + ("readme-link", "README.md"), + ("broken-link", "missing.wasm"), + ] { std::os::unix::fs::symlink(target, bundle.join("src/sausage").join(name))?; } let path = temp.path().join("world"); @@ -35,7 +38,10 @@ fn world_copies_programs_and_nested_source_only_once() -> anyhow::Result<()> { b"source" ); assert!(path.join("world/src/sausage/.git/HEAD").is_file()); - for (name, target) in [("readme-link", "README.md"), ("broken-link", "missing.wasm")] { + for (name, target) in [ + ("readme-link", "README.md"), + ("broken-link", "missing.wasm"), + ] { assert_eq!( std::fs::read_link(path.join("world/src/sausage").join(name))?, Path::new(target) @@ -563,7 +569,13 @@ async fn corpus_matches_bash() { .args(["-c", &script]) .output() .unwrap(); - assert_eq!(cli.status.code(), result.status.code()); + assert_eq!( + cli.status.code(), + result.status.code(), + "CLI stdout: {}\nCLI stderr: {}", + String::from_utf8_lossy(&cli.stdout), + String::from_utf8_lossy(&cli.stderr) + ); assert_eq!( cli.stdout, expected.as_bytes(),