cucumber-rs / cucumber

Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.
https://cucumber-rs.github.io/cucumber/main
Apache License 2.0
563 stars 69 forks source link

Add support for alternatives (`/`) #344

Closed RemiBardon closed 2 weeks ago

RemiBardon commented 2 weeks ago

Could you add support for alternatives (/)?

According to cucumber/cucumber-expressions:

Alternative text

Sometimes you want to relax your language, to make it flow better. For example:

I have {int} cucumber(s) in my belly/stomach

This would match either of those texts:

I have 1 cucumber in my belly
I have 1 cucumber in my stomach
I have 42 cucumbers in my stomach
I have 42 cucumbers in my belly

Alternative text only works when there is no whitespace between the alternative parts.

RemiBardon commented 2 weeks ago

My bad I had misunderstood the docs, I thought I could use / in feature files…