Closed hindman closed 9 years ago
Hmmm. --file-pattern
is implemented as glob-style matching, like bash. --test-pattern
is implemented as a regular expression.
I am pondering whether we should make them both the same style of pattern or not. Seems a bit inconsistent to alternate between pattern matching styles. What are your thoughts?
Hmm, well whatever we decide, this looks great. I'll merge it in and then if we decide to change it, we'll change it.
I agree, they should be the same. I sort of lean toward regex, since it's more powerful, and most users are programmers. But it's only a mild preference. A glob pattern would satisfy most practical use cases. In fact, I often copy a method name to my clipboard from my editor and want to run a single test. Feel free to change it any way you like (or ping me to implement the desired change). Thanks.
Okay, so I ended up reverting your pull request and going in another direction. Take a look and see what you think. I overhauled most things pattern-related:
--test-pattern
as a glob-style pattern (since the above two options are also glob-style). The big change on this one is that I implemented the filtering at the point in GreenTestSuite where the tests are initially added. That way we can simply never add the test to the suite, rather than adding it, and then recreating an entirely new suite without it (which can take a bit for huge test suites).Let me know what you think.
@CleanCut Sounds great to me.
Here's a new pull request, to continue the discussion started in this one: https://github.com/CleanCut/green/pull/46
As always, thanks for taking a look at this.