cooklang / cooklang-swift

Cooklang parser implementation in Swift
https://cooklang.org
MIT License
38 stars 3 forks source link

Separate out tests/expected results from code #2

Closed fugkco closed 2 years ago

fugkco commented 3 years ago

It would be nice to separate out the test cases and the expected results for them into a separate file that's parseable outside of Swift. Something like YAML or JSON format. This allows others to implement this in other languages and rely on the same the cases to validate their implementation.

dubadub commented 3 years ago

@fugkco great idea! Do you know if any other project implement something similar to take as an example?

umgefahren commented 3 years ago

If there would be YAML or JSON tests those formats would have to be specified pretty exact. The specified examples should be in a pretty easy format that also allows lossless conversion to and from recipes. This format could be different than the AST in the Swift implementation.

dubadub commented 3 years ago

@umgefahren I started extracting test-cases into YAML format https://github.com/cooklang/CookInSwift/pull/10/files#diff-108cc582ddc8fb36abf94aa6a115396b00fe3465cfad02ba7a269e005f3a1429. I'm curious if that what you meant?

dubadub commented 2 years ago

Extracted tests, closing the issue.