about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2013-09-30 17:31:59 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2013-09-30 17:35:47 -0700
commit2ec2d7dd23a7ca36b8ef7192b6b21becbfe098b0 (patch)
tree93e3f75df27474967a33c15e5feeeb040deef684 /src
parent7ddcd2a745ab70b3d32249e35b753117b1312d15 (diff)
downloadrust-2ec2d7dd23a7ca36b8ef7192b6b21becbfe098b0.tar.gz
rust-2ec2d7dd23a7ca36b8ef7192b6b21becbfe098b0.zip
rustpkg: Make test_rustpkg_test_output more permissive
test output may contain color codes, so check for several small strings
instead of one big one.
Diffstat (limited to 'src')
-rw-r--r--src/librustpkg/tests.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/librustpkg/tests.rs b/src/librustpkg/tests.rs
index 87abff45dc7..604620d4ea4 100644
--- a/src/librustpkg/tests.rs
+++ b/src/librustpkg/tests.rs
@@ -1812,9 +1812,11 @@ fn test_rustpkg_test_output() {
     let workspace = create_local_package_with_test(&PkgId::new("foo"));
     let output = command_line_test([~"test", ~"foo"], &workspace);
     let output_str = str::from_utf8(output.output);
-    assert!(output_str.contains("test f ... ok"));
-    assert!(output_str.contains(
-        "test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured"));
+    // The first two assertions are separate because test output may
+    // contain color codes, which could appear between "test f" and "ok".
+    assert!(output_str.contains("test f"));
+    assert!(output_str.contains("ok"));
+    assert!(output_str.contains("1 passed; 0 failed; 0 ignored; 0 measured"));
 }
 
 #[test]