You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the assertContains and assertNotContains macros both use grep in such a way that the content argument may not start with a - because it is interpreted as an option to grep.
You can reproduce this easily by doing:
#!/bin/sh
testAssertContainsX() {
assertContains "this should pass but it doesn't" "java -Xmx1g" "-Xmx1g"
}
testAssertContainsD() {
assertContains "this should pass but it doesn't" "java -Dproperty=true" "-Dproperty=true"
}
. ./shunit2
The output currently is this:
testAssertContainsX
grep: Invalid argument
ASSERT:this should pass but it doesn't Not found:<-Xmx1g>
shunit2:ERROR testAssertContainsX() returned non-zero return code.
testAssertContainsD
grep: unknown --devices option
ASSERT:this should pass but it doesn't Not found:<-Dproperty=true>
shunit2:ERROR testAssertContainsD() returned non-zero return code.
Ran 2 tests.
FAILED (failures=4)
The text was updated successfully, but these errors were encountered:
RangerRick
pushed a commit
to RangerRick/shunit2
that referenced
this issue
Feb 7, 2019
the
assertContains
andassertNotContains
macros both usegrep
in such a way that thecontent
argument may not start with a-
because it is interpreted as an option to grep.You can reproduce this easily by doing:
The output currently is this:
The text was updated successfully, but these errors were encountered: