From fe5d9f421e6afd23cc60a960d82bda226415c2be Mon Sep 17 00:00:00 2001 From: technofab Date: Fri, 27 Mar 2026 15:56:33 +0100 Subject: [PATCH] fix(scriptHelpers): remove \n from echo & fix not_contains failing shell --- lib/scriptHelpers.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/scriptHelpers.sh b/lib/scriptHelpers.sh index b1e3514..ba08e47 100644 --- a/lib/scriptHelpers.sh +++ b/lib/scriptHelpers.sh @@ -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 || {