summary refs log tree commit diff
path: root/src/libstd/path
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-06 16:16:35 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-06 21:26:48 -0800
commita64000820f0fc32be4d7535a9a92418a434fa4ba (patch)
tree916024d35e08f0826c20654f629ec596b5cb1f14 /src/libstd/path
parent24ccb34266c93a21b4cd1bef473c56087689c079 (diff)
downloadrust-a64000820f0fc32be4d7535a9a92418a434fa4ba.tar.gz
rust-a64000820f0fc32be4d7535a9a92418a434fa4ba.zip
More test fixes
Diffstat (limited to 'src/libstd/path')
-rw-r--r--src/libstd/path/posix.rs2
-rw-r--r--src/libstd/path/windows.rs11
2 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index 805f45c61c1..0b7dc19fcab 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -1150,7 +1150,7 @@ mod tests {
                     let comps = path.components().collect::<Vec<&[u8]>>();
                     let exp: &[&str] = &$exp;
                     let exps = exp.iter().map(|x| x.as_bytes()).collect::<Vec<&[u8]>>();
-                    assert_eq!(comps, exprs);
+                    assert_eq!(comps, exps);
                     let comps = path.components().rev().collect::<Vec<&[u8]>>();
                     let exps = exps.into_iter().rev().collect::<Vec<&[u8]>>();
                     assert_eq!(comps, exps);
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index bd4b0407bf5..5c4e7aa9ac2 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -1740,8 +1740,8 @@ mod tests {
                     let path = Path::new(pstr);
                     let arg = $arg;
                     let res = path.$op(arg);
-                    let exp = $res;
-                    assert_eq!(Path::new($path).$op($arg), $res);
+                    let exp = Path::new($res);
+                    assert_eq!(res, exp);
                 }
             )
         }
@@ -1920,8 +1920,7 @@ mod tests {
                 {
                     let path = Path::new($path);
                     let (abs, vol, cwd, rel) = ($abs, $vol, $cwd, $rel);
-                    let b = path.is_absolute();
-                    assert_eq!(path.is_absolute(), asb);
+                    assert_eq!(path.is_absolute(), abs);
                     assert_eq!(is_vol_relative(&path), vol);
                     assert_eq!(is_cwd_relative(&path), cwd);
                     assert_eq!(path.is_relative(), rel);
@@ -1955,7 +1954,7 @@ mod tests {
                     let dest = Path::new($dest);
                     let exp = $exp;
                     let res = path.is_ancestor_of(&dest);
-                    assert_eq!(Path::new($path).is_ancestor_of(Path::new($dest)), $exp);
+                    assert_eq!(res, exp);
                 }
             )
         }
@@ -2084,7 +2083,7 @@ mod tests {
         macro_rules! t {
             (s: $path:expr, $other:expr, $exp:expr) => (
                 {
-                    assert_eq!(Path::new($path).path_relative_from(Path::new($other))
+                    assert_eq!(Path::new($path).path_relative_from(&Path::new($other))
                               .as_ref().and_then(|x| x.as_str()), $exp);
                 }
             )