]> git.lizzy.rs Git - rust.git/commitdiff
Fix for filepath for cfail tests in windows
authorJonathan Turner <jturner@mozilla.com>
Fri, 22 Apr 2016 01:24:37 +0000 (18:24 -0700)
committerJonathan Turner <jturner@mozilla.com>
Fri, 22 Apr 2016 01:24:44 +0000 (18:24 -0700)
src/tools/compiletest/src/json.rs

index bbe038509e3a45344e95701e0427b2061ddd6d44..43b5572dfd63f31b01e3f8fc895fabd839d33ad9 100644 (file)
@@ -11,6 +11,7 @@
 use errors::{Error, ErrorKind};
 use rustc_serialize::json;
 use std::str::FromStr;
+use std::path::Path;
 
 // These structs are a subset of the ones found in
 // `syntax::errors::json`.
@@ -82,7 +83,9 @@ fn push_expected_errors(expected_errors: &mut Vec<Error>,
                         file_name: &str) {
     // We only consider messages pertaining to the current file.
     let matching_spans = || {
-        diagnostic.spans.iter().filter(|span| span.file_name == file_name)
+        diagnostic.spans.iter().filter(|span| {
+            Path::new(&span.file_name) == Path::new(&file_name)
+        })
     };
 
     // We break the output into multiple lines, and then append the