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

make check fails on strftime if the locale setting is not english. #3038

Closed
steve-anunknown opened this issue Feb 10, 2024 · 1 comment · Fixed by #3039
Closed

make check fails on strftime if the locale setting is not english. #3038

steve-anunknown opened this issue Feb 10, 2024 · 1 comment · Fixed by #3039

Comments

@steve-anunknown
Copy link

I'm not sure whether this is a bug or not because I am not aware of the desired behaviour.

When running "make check" all of the tests pass except 2 tests:

  1. In file jq.test:
strftime("%A, %B %d, %Y")
1435677542.822351
"Tuesday, June 30, 2015"
  1. In file optional.test:
strftime("%A, %B %e, %Y")
1435677542.822351
"Tuesday, June 30, 2015"

For each case the logs (test-suite.log) mention:
1)*** Expected "Tuesday, June 30, 2015", but got "Τρίτη, Ιουνίου 30, 2015" for test at line number 1564: strftime("%A, %B %d, %Y")
2)*** Expected "Tuesday, June 30, 2015", but got "Τρίτη, Ιουνίου 30, 2015" for test at line number 18: strftime("%A, %B %e, %Y")

I believe that this is related to the locale setting. The output of the "locale" regarding time is:

> locale | grep LC_TIME
LC_TIME=el_GR.UTF-8

Changing the locale setting to en_US.utf-8 with export LC_TIME=en_US.utf8 and running make check, results to all of the tests passing.

I don't know what the expected behavior is, but my opinion is that locale settings could be taken into consideration, so that these tests don't fail, given that the output is actually correct.

Environment

  • OS: Ubuntu 22.04.3 LTS x86_64
  • jq : jq-1.7.1-25-g623d7a8
@steve-anunknown steve-anunknown changed the title Make check fails on "strftime" if the locale setting is not english. Make check fails on strftime if the locale setting is not english. Feb 10, 2024
@steve-anunknown steve-anunknown changed the title Make check fails on strftime if the locale setting is not english. make check fails on strftime if the locale setting is not english. Feb 10, 2024
emanuele6 added a commit to emanuele6/jq-1 that referenced this issue Feb 10, 2024
@emanuele6
Copy link
Member

Thank you for this report!

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

Successfully merging a pull request may close this issue.

2 participants