zig-yaml icon indicating copy to clipboard operation
zig-yaml copied to clipboard

YAML 1.2 Test Case Generator

Open Bergasms opened this issue 2 years ago • 4 comments

  • Contains updates to the parser to resolve build errors (thing.field_type -> thing.type).
  • Added a generator that will automatically build tests cases from the YAML 1.2 compliance set if present.
  • Removed some null optional unwraps in the parser that were causing the parser to crash on some of the test cases.

begins the process of resolving https://github.com/kubkon/zig-yaml/issues/16

Bergasms avatar Feb 01 '23 06:02 Bergasms

Looks like there are some formatting issues in src/parse.zig. Would you mind fixing those?

kubkon avatar Feb 03 '23 14:02 kubkon

Looks like there are some formatting issues in src/parse.zig. Would you mind fixing those?

Ah, yes I had the formatter off. I can do.

Bergasms avatar Feb 05 '23 10:02 Bergasms

I see that the CI is trying to run the spec tests even though we haven't provided any: https://github.com/kubkon/zig-yaml/actions/runs/4096254949/jobs/7084964904#step:6:5

I see two possible solutions here: 1) we make the spec test part of this repo via submodule or otherwise, or 2) we add a conditional build flag such as -Denable-spec-tests which puts the burden of actually cloning the tests on the user using the flag when running the zig build test -Denable-spec-tests. Initially, I am happy to go with the latter, however, I think that eventually we will want to make spec tests a submodule dep (or otherwise) of this repo and run them on every push in the CI. Lemme know what you think!

Also, if you decide to go with the latter, here's an example of how something similar is being done for the Zig compiler itself: https://github.com/ziglang/zig/blob/a5b34a61ab61882bf55d87e4cbc8186215ecf320/build.zig#L106 If you follow all callsites of this variable, you will hopefully get a good idea how it's architected.

kubkon avatar Feb 07 '23 10:02 kubkon

Cheers, I will have a look at the next opportunity :)

Bergasms avatar Feb 07 '23 13:02 Bergasms