Fix Intermittent tests/date/date-locale-hour.sh#11497
Fix Intermittent tests/date/date-locale-hour.sh#11497sylvestre wants to merge 5 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
Merging this PR will not alter performance
Comparing Footnotes
|
c4d86ed to
e66702c
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
84bbc0d to
857d820
Compare
|
GNU testsuite comparison: |
| let stdout_bytes = result.stdout(); | ||
| assert_eq!(stdout_bytes[0], 0xFF); | ||
| assert_eq!(&stdout_bytes[1..3], b"10"); |
There was a problem hiding this comment.
You can simplify it by using stdout_is_bytes:
.succeeds()
.stdout_is_bytes(b"\xFF10\n");| let stdout_bytes = result.stdout(); | ||
| // \xC4\xEA + "10" + \xD4\xC2 + "11" + \xC8\xD5 + "\n" | ||
| assert_eq!(stdout_bytes, b"\xc4\xea10\xd4\xc211\xc8\xd5\n"); |
857d820 to
a25d90b
Compare
| utc: bool, | ||
| format: Format, | ||
| /// Raw format bytes for Custom format, to preserve non-UTF-8 bytes in output | ||
| format_raw: Option<Vec<u8>>, |
There was a problem hiding this comment.
Why do you introduce an additional property instead of adapting the Format enum?
| return Err(USimpleError::new( | ||
| 1, | ||
| translate!("date-error-extra-operand", "operand" => format_args[1]), | ||
| translate!("date-error-extra-operand", "operand" => format_args[1].to_string_lossy()), |
There was a problem hiding this comment.
GNU date doesn't use a lossy string in this case. But it is only an error message so it depends on how close we want to be to GNU date.
$ date -d "2025-12-16" +%m $'+\xFF%Y'
date: extra operand ‘+\377%Y’
|
GNU testsuite comparison: |
| let format = if let Some(form) = matches.get_one::<OsString>(OPT_FORMAT) { | ||
| let raw_bytes = form.as_encoded_bytes(); | ||
| if raw_bytes.first() != Some(&b'+') { | ||
| let form_lossy = form.to_string_lossy(); |
|
GNU testsuite comparison: |
Fixes intermittent: tests/date/date-locale-hour.sh The GNU test date-locale-hour.sh picks 10 random locales via `locale -a | shuf -n 10`. In CI, zh_CN.GB18030 is installed and its date_fmt contains Chinese characters (年, 月, 日) encoded in GB18030, which is not valid UTF-8.
7ac2d9b to
e23df9b
Compare
|
GNU testsuite comparison: |
No description provided.