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

Tests of various grammars fail in locales with "," decimal separator #402

Closed
th-we opened this issue Jul 30, 2019 · 2 comments
Closed

Tests of various grammars fail in locales with "," decimal separator #402

th-we opened this issue Jul 30, 2019 · 2 comments
Labels

Comments

@th-we
Copy link

th-we commented Jul 30, 2019

This issue occurs in a number of grammars, so I'm raising it here first before creating pull requests for the individual repos.

When running npm test e.g. on the tree-sitter-python grammar, the test fails:

script/parse-examples: Zeile 38: printf: 100.00000000000000000000: Ungültige Zahl.
Successfully parsed 0,00% of examples/numpy (407 of 407 files)
npm ERR! Test failed.  See above for more details.

This is my current setup:

$ echo "$OSTYPE"
linux-gnu
$ echo "$LANG"
de_DE.UTF-8
$ echo "$BASH_VERSION"
4.4.20(1)-release

The issue is caused by the script/parse-examples scripts of the Haskell, Ruby, Python, JavaScript, Rust, Go, Java and Julia grammars.

Options for fixing this:

  1. set LC_NUMERIC=C in the script
  2. in package.json, change the test script call to tree-sitter test && LANG=C script/parse-examples
  3. at least document that tests should be run like LANG=C npm test

If there is an agreement, I'll create pull requests. Option 1 seems the most robust solution to me.

@issue-label-bot issue-label-bot bot added the bug label Jul 30, 2019
@maxbrunsfeld
Copy link
Contributor

I'd be ok with adding LC_NUMERIC=C. I'd also be fine with just simplifying down to integer percentages, and avoiding floating point numbers entirely.

@maxbrunsfeld
Copy link
Contributor

I'm going to close this out, since it's not an issue with this repo. If you're interested in opening PRs to fix the shell scripts, I'd merge them.

@tree-sitter tree-sitter deleted a comment from issue-label-bot bot Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants