summaryrefslogtreecommitdiff
path: root/tests/kolainst/libtest-core.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/kolainst/libtest-core.sh')
-rw-r--r--tests/kolainst/libtest-core.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/kolainst/libtest-core.sh b/tests/kolainst/libtest-core.sh
index 945d2857..64b3e0a3 100644
--- a/tests/kolainst/libtest-core.sh
+++ b/tests/kolainst/libtest-core.sh
@@ -115,6 +115,16 @@ assert_file_has_content () {
done
}
+assert_file_has_content_once () {
+ fpath=$1
+ shift
+ for re in "$@"; do
+ if ! test $(grep -e "$re" "$fpath" | wc -l) = "1"; then
+ _fatal_print_file "$fpath" "File '$fpath' doesn't match regexp '$re' exactly once"
+ fi
+ done
+}
+
assert_file_has_content_literal () {
fpath=$1; shift
for s in "$@"; do