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

[test] Add jsontestsuite #2024

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

[test] Add jsontestsuite #2024

wants to merge 3 commits into from

Conversation

ellen364
Copy link
Collaborator

This is a hacky way of running nst/JSONTestSuite. It's a starting point for conversation, not something that's mergeable.

Run using python3 jsontestsuite/run_tests.py which produces a log.txt and 2x html files in results/

The original Python script assumes a particular directory structure and presence of certain files when producing results.

If one library is tested, the results only show failures and implementation specific tests. (The original Python script wants to compare results between libraries.) A simple way to get more output was to run another library (e.g. Bash) to compare and one that isn't installed (e.g. Awk, which the script assumes will be in a specific directory) and will always fail.

This is a hacky way of running nst/JSONTestSuite. It's a starting point
for conversation, not something that's mergeable.

Run using `python3 jsontestsuite/run_tests.py` which
produces a `log.txt` and 2x html files in `results/`

The original Python script assumes a particular directory
structure and presence of certain files when producing results.

If one library is tested, the results only show failures and
implementation specific tests. (The original Python script wants to
compare results between libraries.) A simple way to get more output was
to run another library (e.g. Bash) to compare and one that isn't
installed (e.g. Awk, which the script assumes will be in a specific
directory) and will always fail.
@andychu
Copy link
Contributor

andychu commented Jul 16, 2024

Thanks for figuring this out! That kind of thing is why I didn't get around to it myself :-/

I have to review some PRs for Melvin tonight

In the meantime, if you think the failure is a real bug (sounds like it), please file an issue on github, showing how Oils diverges from the JSON spec (and it would be interesting to see that Python/JavaScript conforms, etc.)

I linked this comment in the Zulip thread, and I'm more than happy to honor it - https://lobste.rs/s/1y9hjq/regular_json#c_8tvoie

@ellen364
Copy link
Collaborator Author

I've written it up as #2026.

@andychu
Copy link
Contributor

andychu commented Jul 22, 2024

This is excellent, thank you!

Actually I changed it to use the C++ version and it found an overflow bug too ... for big positive and negative integers

I am going to fix all these :)

@andychu
Copy link
Contributor

andychu commented Jul 22, 2024

Hm since this found some bugs, I wonder how test_transform works ...

there are fewer cases there

https://github.com/nst/JSONTestSuite/tree/master/test_transform

@andychu
Copy link
Contributor

andychu commented Jul 22, 2024

Hm somehow these other cases aren't automated in the original repo?

andy@hoover:~/git/oilshell/JSONTestSuite$ grep test_parsing run_tests.py 
TEST_CASES_DIR_PATH = os.path.join(BASE_DIR, "test_parsing")

andy@hoover:~/git/oilshell/JSONTestSuite$ grep transform run_tests.py 

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

Successfully merging this pull request may close these issues.

2 participants