gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
11.46k stars 855 forks source link

Consider using Gherkin for tests #4304

Open pjoe opened 4 years ago

pjoe commented 4 years ago

Just wondering if it could make sense to use Gherkin for some tests.

https://cucumber.io/docs/gherkin/reference/

Maybe using tables and outlines could be useful:

https://github.com/b-yond-infinite-network/jest-cucumber-fusion/blob/master/docs/GherkinTables.md

https://github.com/b-yond-infinite-network/jest-cucumber-fusion/blob/master/docs/ScenarioOutlines.md

pjoe commented 4 years ago

Found this for rust: https://github.com/bbqsrc/cucumber-rust

kvark commented 4 years ago

Thank you for filing this! It's great to see a native Rust implementation, this would be a non-option without it :)

Is there an elevator pitch on how we'd benefit from it, and what the downsides are? So far, it looks like a meta-language for tests. Is there a benefit of introducing this meta-language instead of just writing it in Rust to begin with?

pjoe commented 4 years ago

I'm sure there is a better pitch to be found somewhere, but for me I've found gherkin to be useful for these reasons:

That being said, I'm not sure it is always beneficial for use in unit tests.

Anyway just an idea for consideration :)

See also: