4
* Testing the System.setCWD() function
6
* setCWD() sets the current working directory
9
var cwd = System.getCWD().unwrap();
11
assert(type(cwd) == "string");
12
assert(cwd.len() > 0);
13
assert(System.setCWD("/").success() == true);
14
if (System.platform == "windows") {
15
assert(System.getCWD().unwrap() == "C:\\" or System.getCWD().unwrap() == "D:\\");
17
assert(System.getCWD().unwrap() == "/");
19
assert(System.setCWD(cwd).success() == true);
20
assert(System.getCWD().unwrap() == cwd);
21
assert(System.setCWD("some/directory/that/doesnt/exist").success() == false);
22
assert(System.setCWD("some/directory/that/doesnt/exist").unwrapError() == "No such file or directory");