]> git.proxmox.com Git - cargo.git/commitdiff
Make a test a bit more robust to the environment
authorAlex Crichton <alex@alexcrichton.com>
Fri, 8 Apr 2016 20:30:45 +0000 (13:30 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 8 Apr 2016 20:31:16 +0000 (13:31 -0700)
Don't filter out PATH as `rustc` may be in that directory (e.g. when using
rustup) and otherwise just have a longer subcommand.

Closes #2553

tests/test_cargo.rs

index 7b5b6361297e353b8dbe37b17bb79d0dcfb9c427..35241ac64fa6f9144e89849bfe31aa660ce1211a 100644 (file)
@@ -71,16 +71,9 @@ error = ERROR)));
 
 // if a subcommand is more than 3 edit distance away, we don't make a suggestion
 test!(find_closest_dont_correct_nonsense {
-    let paths = path().into_iter().filter(|p| {
-        fs::read_dir(p).into_iter()
-           .flat_map(|i| i)
-           .filter_map(|e| e.ok())
-           .all(|e| !e.file_name().to_str().unwrap_or("").starts_with("cargo-"))
-    });
     let mut pr = cargo_process();
-    pr.arg("asdf")
-      .cwd(&paths::root())
-      .env("PATH", env::join_paths(paths).unwrap());
+    pr.arg("there-is-no-way-that-there-is-a-command-close-to-this")
+      .cwd(&paths::root());
 
     assert_that(pr,
                 execs().with_status(101)