-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test string:string_upper is locale dependent #1298
Comments
This is a known problem (I think I once filed a similar bug, although I can't find it) and many of the functions take an "encoding" parameter to deal with this. There's not a lot that can be done if the cause is the underlying C functions and locale. Possibly related: #1013 |
It is reasonable that certain predicates behave differently depending on the set locale. But the build should not pass or fail based on the locales in the build environment. So any automated tests that run as part of that build should be able to deal with locales being different. I think we could probably just hardcode the locale used during the build or something. |
Note that other tests require a UTF-8 based locale. I think they are silently disabled if this is not the case. I am not aware of a portable way to get a suitable locale. On (most?) Linux systems, |
Pushed a patch that makes the test pass regardless of the locale. It turns out that one can specify the environment for a test using the ENVIRONMENT property on a test. The next challenge is a way to get the name of a Unicode-aware locale that works on all systems? |
The test run for the master branch now runs without failures for me in all environments. That means I can now turn on those tests by default as part of the package build. Yay :)
Nothing is better than |
Does not exist on MacOS 😢 The GNU docs say only |
While building SWI-Prolog from source, I discovered ctest would fail in certain environments and not in others. It turns out that there's a single test,
string:string_upper
, which succeeds or fails depending on the contents of theLANG
environment variable. This test mentions #1262 as a related issue, so I am linking it here.Since the relevant test is just plain prolog we can actually easily reproduce outside of the build.
In a swipl source tree, run
Which on my machine gives me
Since the tests are run through ctest, similarly
from the build directory will trigger this.
The text was updated successfully, but these errors were encountered: