Skip to content

Commit 918dd34

Browse files
committed
Attempt fix for assertion on Windows, and add extra output for debugging.
1 parent 06d4019 commit 918dd34

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/test/run-pass/issue-15149.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::path::BytesContainer;
1112
use std::io::{Command, fs, USER_RWX};
1213
use std::os;
1314

1415
fn main() {
1516
// If we're the child, make sure we were invoked correctly
1617
let args = os::args();
1718
if args.len() > 1 && args[1].as_slice() == "child" {
18-
return assert_eq!(args[0].as_slice(), "mytest");
19+
return assert_eq!(args[0],
20+
format!("mytest{}", os::consts::EXE_SUFFIX));
1921
}
2022

2123
test();
@@ -38,7 +40,12 @@ fn test() {
3840
path.push(child_dir.clone());
3941
let path = os::join_paths(path.as_slice()).unwrap();
4042

41-
assert!(Command::new("mytest").env("PATH", path.as_slice())
42-
.arg("child")
43-
.status().unwrap().success());
43+
let child_output = Command::new("mytest").env("PATH", path.as_slice())
44+
.arg("child")
45+
.output().unwrap();
46+
47+
assert!(child_output.status.success(),
48+
format!("child assertion failed\n child stdout:\n {}\n child stderr:\n {}",
49+
child_output.output.container_as_str().unwrap(),
50+
child_output.error.container_as_str().unwrap()));
4451
}

0 commit comments

Comments
 (0)