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

Generate tests from spec document #131

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Generate tests from spec document #131

merged 1 commit into from
Jan 18, 2023

Conversation

epage
Copy link
Contributor

@epage epage commented Jan 16, 2023

I used "header + fence index within header" to try to give some level of stability to the file names across changes (as compared to using line numbers)

Fixes #129

@arp242
Copy link
Collaborator

arp242 commented Jan 16, 2023

Ah, I had misunderstood the issue you reported earlier; what I thought you meant was to take the ABNF file and use that to generate a whole bunch of permutations based on the syntax description in there.

@arp242
Copy link
Collaborator

arp242 commented Jan 16, 2023

Here's a patch to also generate the JSON files automatically: 3b92c71

The JSON files changed because the output is a bit different (ordered alphabetically by key), but they should be semantically identical.

@epage
Copy link
Contributor Author

epage commented Jan 16, 2023

Thanks for fixing up the json files! I assumed my formatting was off than expected but I wasn't sure if there was a standard way of generating them (the README doesn't mention a "write out json" for writing tests) and I don't have a go toolchain setup

@arp242
Copy link
Collaborator

arp242 commented Jan 18, 2023

I wasn't sure if there was a standard way of generating them

There wasn't until I thought of it the other day 🙃 I always did it manually before and then I facepalmed and realized I can use toml-test-decoder for this.

@arp242 arp242 merged commit 932693d into toml-lang:master Jan 18, 2023
@arp242
Copy link
Collaborator

arp242 commented Jan 18, 2023

I merged both gen-*.pyfiles togen.py` and merged it; thanks!

@epage epage deleted the spec branch January 18, 2023 14:07
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.

Generate tests from the spec?
2 participants