dont use grep -P for cross-platform compatibility

`grep -P` gives access to the PCRE matching engine, which is nice,
however, the version of grep shipped on many BSD systems (including
Darwin) does not have this flag.

Currently, `grep -P` was being used in the `_includes()` test helper.

For cross platform compatibility in tests, do not rely upon this option.
Luckily, all existing tests seem to work fine without it already!
This commit is contained in:
Matthew Rothenberg
2014-10-16 12:19:11 -04:00
parent f056d28b2e
commit b395596496
2 changed files with 2 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ verboseGitCommands() {
#-----------------------------------------------------------------------------
_includes() {
if [ -n "$3" ]; then regex="$3"; else regex=P; fi
if [ -n "$3" ]; then regex="$3"; else regex=''; fi
if echo "$1" | grep -q$regex "$2"; then echo 0; else echo 1; fi
}
@@ -46,4 +46,3 @@ assertIncludes() {
assertNotIncludes() {
assertFalse "'$1' should not have contained '$2'" $(_includes "$@")
}