assert_cli icon indicating copy to clipboard operation
assert_cli copied to clipboard

cargo test doesn't like non english locales

Open est31 opened this issue 7 years ago • 1 comments

When I'm doing cargo test, I get the following error output (excerpt):

---- src/assert.rs - assert::Assert::fails_with (line 238) stdout ----
        thread 'rustc' panicked at 'test executable failed:

thread 'main' panicked at 'Error: CLI assertion failed: `cat non-existing-file` StdErr mismatch: diff:
 
-cat: non-existing-file: No such file or directory
+cat: non-existing-file: Datei oder Verzeichnis nicht gefunden 

', src/assert.rs:406:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.

', librustdoc/test.rs:324:17
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- src/assert.rs - assert::Assert::ignore_status (line 260) stdout ----
        thread 'rustc' panicked at 'test executable failed:

thread 'main' panicked at 'Error: CLI assertion failed: `cat non-existing-file` StdErr mismatch: diff:
 
-cat: non-existing-file: No such file or directory
+cat: non-existing-file: Datei oder Verzeichnis nicht gefunden 

', src/assert.rs:406:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.

', librustdoc/test.rs:324:17

---- src/assert.rs - assert::Assert::stderr (line 300) stdout ----
        thread 'rustc' panicked at 'test executable failed:

thread 'main' panicked at 'Error: CLI assertion failed: `cat non-existing-file` StdErr mismatch: diff:
 
-cat: non-existing-file: No such file or directory
+cat: non-existing-file: Datei oder Verzeichnis nicht gefunden 

', src/assert.rs:406:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.

', librustdoc/test.rs:324:17


failures:
    src/assert.rs - assert::Assert::fails_with (line 238)
    src/assert.rs - assert::Assert::ignore_status (line 260)
    src/assert.rs - assert::Assert::stderr (line 300)

test result: FAILED. 24 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--doc'

As you might see I have a default german locale. It would be nice if cargo test would work smoothly here, e.g. by removing all env vars and then setting LANG=en_US.UTF-8 or something.

est31 avatar Jan 21 '18 22:01 est31

Thanks for reporting this!

Improving the project so it can easily be run on any machine seems worthwhile.

epage avatar Jan 22 '18 13:01 epage