mirror of
https://github.com/nushell/nushell.git
synced 2025-03-25 05:57:18 +01: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
@ -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 New Issue
Block a user