mirror of
https://github.com/nushell/nushell
synced 2024-12-27 21:43:09 +00:00
Make open
test independent of locale (#6211)
The test was reading the operating system error message which is dependent on the system locale. Just test for the `(os error 2)` errorcode instead. This should support both unixoid systems and Windows in more locales.
This commit is contained in:
parent
376d22e331
commit
56069af42d
1 changed files with 5 additions and 6 deletions
|
@ -214,12 +214,11 @@ fn errors_if_file_not_found() {
|
|||
cwd: "tests/fixtures/formats",
|
||||
"open i_dont_exist.txt"
|
||||
);
|
||||
|
||||
#[cfg(windows)]
|
||||
let expected = "The system cannot find the file specified. (os error 2)";
|
||||
|
||||
#[cfg(not(windows))]
|
||||
let expected = "No such file or directory (os error 2)";
|
||||
// Common error code between unixes and Windows for "No such file or directory"
|
||||
//
|
||||
// This seems to be not directly affected by localization compared to the OS
|
||||
// provided error message
|
||||
let expected = "(os error 2)";
|
||||
|
||||
assert!(
|
||||
actual.err.contains(expected),
|
||||
|
|
Loading…
Reference in a new issue