Skip to content
This repository was archived by the owner on Nov 22, 2025. It is now read-only.

Consolidate most examples data into a YAML file#53

Merged
samestep merged 3 commits intomainfrom
examples-yaml
Apr 4, 2021
Merged

Consolidate most examples data into a YAML file#53
samestep merged 3 commits intomainfrom
examples-yaml

Conversation

@samestep
Copy link
Copy Markdown
Owner

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant