Skip to content
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

Locale / OS dependent tests #109

Open
BlazingTwist opened this issue Nov 1, 2024 · 0 comments
Open

Locale / OS dependent tests #109

BlazingTwist opened this issue Nov 1, 2024 · 0 comments

Comments

@BlazingTwist
Copy link
Contributor

Starting with Java 11, localization is behaving weirdly and causes tests to fail.
Despite mvn --version showing Default locale: en_GB, when running tests I get failures such as:

Expected: "< 0 .84147098 >"
Received: "< 0 ,84147098 >"

I can think of 2 solutions:

  • remove localization of numbers (StringUtils: _df = new DecimalFormat("#", DecimalFormatSymbols.getInstance(Locale.ROOT));)
  • disable localization when running tests (pass -Duser.language=en -Duser.country=US)

I'm leaning towards the first, because 1.5 P ~ should never fail with Unexpected token 1,5


Additionally test_list and golf_examples might fail on Windows.

"""A B CCC

"ABCDEFGHIJKLMNOPQRSTUVWXYZ

It failed on my end, because git autocrlf was enabled and all \n were converted to \r\n
The resulting error is:

Assert Error:
  Expected: "A B  CCC
D EE F  "
  Received: "A B  CCC
D EE F  "

Strictly speaking, this is user-error, however, it seems you have also accidentally commit files with \r\n
https://github.com/aya-lang/aya/blob/3ab481f2eb3d14aac7d9a154db3c44a9bff12cf6/std/dialog.aya

So I think this should be fixed.
E.g. by using ["foo" "bar"] "\n" % for the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant