mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2026-05-04 10:19:32 +02:00
fix(scriptHelpers): remove \n from echo & fix not_contains failing shell
This commit is contained in:
parent
9f9fcb8534
commit
fe5d9f421e
1 changed files with 5 additions and 5 deletions
|
|
@ -11,16 +11,16 @@ function assert_not_eq() {
|
|||
assert "$1 -ne $2" "$3"
|
||||
}
|
||||
function assert_contains() {
|
||||
echo "$1" | grep -q -- "$2" || {
|
||||
echo "Assertion failed: $3. $1 does not contain $2" >&2;
|
||||
echo -n "$1" | grep -q -- "$2" || {
|
||||
echo "Assertion failed: $3. The following does not contain $2: $1" >&2;
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
function assert_not_contains() {
|
||||
echo "$1" | grep -q -- "$2" && {
|
||||
echo "Assertion failed: $3. $1 does contain $2" >&2;
|
||||
echo -n "$1" | grep -q -- "$2" && {
|
||||
echo "Assertion failed: $3. The following does contain $2: $1" >&2;
|
||||
exit 1;
|
||||
}
|
||||
} || true
|
||||
}
|
||||
function assert_file_contains() {
|
||||
grep -q -- "$2" $1 || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue