提交 bc6dd906 编写于 作者: B bors

auto merge of #9640 : catamorphism/rust/rustpkg-test-fix, r=alexcrichton

r? @alexcrichton test output may contain color codes, so check for several small strings
instead of one big one.
...@@ -1812,9 +1812,11 @@ fn test_rustpkg_test_output() { ...@@ -1812,9 +1812,11 @@ fn test_rustpkg_test_output() {
let workspace = create_local_package_with_test(&PkgId::new("foo")); let workspace = create_local_package_with_test(&PkgId::new("foo"));
let output = command_line_test([~"test", ~"foo"], &workspace); let output = command_line_test([~"test", ~"foo"], &workspace);
let output_str = str::from_utf8(output.output); let output_str = str::from_utf8(output.output);
assert!(output_str.contains("test f ... ok")); // The first two assertions are separate because test output may
assert!(output_str.contains( // contain color codes, which could appear between "test f" and "ok".
"test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured")); assert!(output_str.contains("test f"));
assert!(output_str.contains("ok"));
assert!(output_str.contains("1 passed; 0 failed; 0 ignored; 0 measured"));
} }
#[test] #[test]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册