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

Consolidate most examples data into a YAML file #53

Merged
merged 3 commits into from
Apr 4, 2021
Merged

Conversation

samestep
Copy link
Collaborator

@samestep samestep commented Apr 4, 2021

This PR renames all the examples/compile/out/*.txt files to examples/*.js so that GitHub and editors syntax-highlight them, and moves the rest of the output data to a single file called tests/goldenfiles/examples.yml. This reduces verbosity and will make it easier to add new types of data, such as the list of CLI args to pass to each example.

As mentioned in the comments in tests/cli.rs, I wrote a custom YAML serializer for this file because yaml-rust does not currently support emitting literal scalars:

However, I still use that library (through serde_yaml) to parse the generated file and thus ensure that my custom serializer works correctly (at least, in the single case where it is used).

@samestep samestep merged commit c6235de into main Apr 4, 2021
@samestep samestep deleted the examples-yaml branch April 4, 2021 18:55
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.

1 participant