about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2015-01-25 10:52:55 +0100
committerFlavio Percoco <flaper87@gmail.com>2015-01-25 13:05:37 +0100
commit7e83e46556fea9f448e47f7879f5970c400fb24c (patch)
tree7e80eaa171e84541f81c626f3df5be3ccd296938 /src
parent577c4643dd3f098697c17606e64d92477247d4b5 (diff)
downloadrust-7e83e46556fea9f448e47f7879f5970c400fb24c.tar.gz
rust-7e83e46556fea9f448e47f7879f5970c400fb24c.zip
assert path ends with executable. On Windows the process executable contains the full path
Diffstat (limited to 'src')
-rw-r--r--src/test/run-pass/issue-15149.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/run-pass/issue-15149.rs b/src/test/run-pass/issue-15149.rs
index 5d3571e4d74..bf395b14eb4 100644
--- a/src/test/run-pass/issue-15149.rs
+++ b/src/test/run-pass/issue-15149.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use std::slice::SliceExt;
 use std::io::{Command, fs, USER_RWX};
 use std::os;
 use std::path::BytesContainer;
@@ -17,8 +18,11 @@ fn main() {
     // If we're the child, make sure we were invoked correctly
     let args = os::args();
     if args.len() > 1 && args[1].as_slice() == "child" {
-        return assert_eq!(args[0],
-                          format!("mytest{}", os::consts::EXE_SUFFIX));
+        // FIXME: This should check the whole `args[0]` instead of just
+        // checking that it ends_with the executable name. This
+        // is needed because of Windows, which has a different behavior.
+        // See #15149 for more info.
+        return assert!(args[0].ends_with(&format!("mytest{}", os::consts::EXE_SUFFIX)[]));
     }
 
     test();