Closed talau closed 2 years ago
Thanks for letting me know; looks like using C.UTF-8
fixes the issue. I also see that a few other tests might fail due to UID/PID assumptions.
Hmm, looks like that locale isn't on my system by default, either. C
might have to do.
Yep, I think that changing en_US.UTF-8 to C in os.Setenv on interp_test.go/parser_test.go fixes the issue.
It's unfortunately not that easy, because C
implies no UTF-8, and some of the tests assume it. I think I'll have to go with C.UTF-8
, with perhaps some form of logic to detect whether it's present. Arch Linux doesn't have it for instance, as glibc won't ship with it until 2.35.
Hi there!
I tested on Debian and it's fixed the issue! Thanks @mvdan!
You can see the log here: https://salsa.debian.org/talau-guest/shfmt-tests-minimal/-/jobs/2277914/raw
Hi there!
On Linux, when you run tests on a chroot/docker that do not have locales installed and configured, some tests, like parser_test.go and interp_test.go, fail.
One example of fail:
=== CONT TestRunnerRunConfirm/#133 interp_test.go:3280: wrong bash output in "INTERP_GLOBAL=; $ENV_PROG | grep '^INTERP_GLOBAL='": want: "INTERP_GLOBAL=\n" got: "bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)\nINTERP_GLOBAL=\n"
As some systems, like Debian, use CI tests in an environment like that, please, can you consider ignoring warnings like this on the tests?
Cheers, mt