We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8df017 commit 8368d4fCopy full SHA for 8368d4f
tests/run-pass/change_current_dir.rs renamed to tests/run-pass/current_dir.rs
@@ -6,6 +6,9 @@ use std::path::Path;
6
fn main() {
7
// test that `getcwd` is available
8
let cwd = env::current_dir().unwrap();
9
+ // test that changing dir to `..` actually sets the current directory to the parent of `cwd`.
10
+ // the only exception here is if `cwd` is the root directory, then changing directory must
11
+ // keep the current directory equal to `cwd`.
12
let parent = cwd.parent().unwrap_or(&cwd);
13
// test that `chdir` is available
14
assert!(env::set_current_dir(&Path::new("..")).is_ok());
0 commit comments