cucumber / godog

Cucumber for golang
MIT License
2.2k stars 246 forks source link

Tag Filtering Expressions #613

Open SamStentz opened 1 month ago

SamStentz commented 1 month ago

πŸ‘“ What did you see?

tag filtering doesn't support nesting parentheses (more of a feature), nor does it implement commutativity of boolean algebra (why I made this a bug).

source code implementation

βœ… What did you expect to see?

Parentheses and PEMDAS respect.

πŸ“¦ Which tool/library version are you using?

v0.14.0

πŸ”¬ How could we reproduce it?

could use above example in newest release.

Steps to reproduce the behavior:

  1. Install '...' version '...'
  2. Create a file called '....'
  3. Run command '....'
  4. See error '....'

example test cases that I would hope for from the unit testing

var testcases = []testcase{
        ...
    {filter: "@ten, (@one && @two)", expected: []*pickle{p2, p3}}, // evaluate `,` second by setting parentheses, a feature
    {filter: "@three && @two, @one", expected: []*pickle{p1, p2, p3}}, // evaluate `,` and `&&` left to right, a bug (current behavior would be to only pass p3)
        ...
}

πŸ“š Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

SamStentz commented 1 month ago

Also want to thank all yall for your hard work!