mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
`LANGUAGE=C` is not enough, `LC_ALL=C` is needed as the environment variable that overrides all the other localization settings. e.g. ```bash $ LANGUAGE=C id foobar id: ‘foobar’: no such user $ LC_ALL=C id foobar id: 'foobar': no such user ``` * replace `LANGUAGE` with `LC_ALL` as environment variable in the tests * fix the the date string of affected uutils * replace `‘` and `’` with `'`
This commit is contained in:
parent
d3181fa60e
commit
c0be979611
41 changed files with 135 additions and 140 deletions
|
@ -158,13 +158,12 @@ fn test_users() {
|
|||
let mut v_actual: Vec<&str> = actual.split_whitespace().collect();
|
||||
let mut v_expect: Vec<&str> = expect.split_whitespace().collect();
|
||||
|
||||
// TODO: `--users` differs from GNU's output on macOS
|
||||
// Diff < left / right > :
|
||||
// <"runner console 2021-05-20 22:03 00:08 196\n"
|
||||
// >"runner console 2021-05-20 22:03 old 196\n"
|
||||
// TODO: `--users` sometimes differs from GNU's output on macOS (race condition?)
|
||||
// actual: "runner console Jun 23 06:37 00:34 196\n"
|
||||
// expect: "runner console Jun 23 06:37 old 196\n"
|
||||
if cfg!(target_os = "macos") {
|
||||
v_actual.remove(4);
|
||||
v_expect.remove(4);
|
||||
v_actual.remove(5);
|
||||
v_expect.remove(5);
|
||||
}
|
||||
|
||||
assert_eq!(v_actual, v_expect);
|
||||
|
@ -242,7 +241,7 @@ fn expected_result(args: &[&str]) -> String {
|
|||
#[allow(clippy::needless_borrow)]
|
||||
TestScenario::new(&util_name)
|
||||
.cmd_keepenv(util_name)
|
||||
.env("LANGUAGE", "C")
|
||||
.env("LC_ALL", "C")
|
||||
.args(args)
|
||||
.succeeds()
|
||||
.stdout_move_str()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue