shunit2
shunit2 copied to clipboard
Regex (not)Contains & equals
We now have an assertContains
, but what I still miss is a RegEx-version of that, so I can (use case:) do assertContainsRegEx "$archiveList" "^prefix1_"
or so and I get check for prefix/suffixes etc.
Also this needs to be flexible enough to check the input per line or globally (RegEx stuff, as usual).
Previously I've just used an assertTrue
and a grep
for that. This works great.
Obviously, the same may be done for "equals".
Shouldn't that just be assertMatches
and assertNotMatches
? Tests can put line start and line end markers into the regex to distinguish between contains, equals, startswith, and endswith.
There is no assertMatches
in the code currently, it's also not documented in the Readme.
Of course not. But there's no assertContainsRegEx
either. I merely suggested a different name.
Yeah good name. Did misunderstood that…
This would be cool