summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2025-07-11 23:24:46 +0200
committerMarc Vertes <mvertes@free.fr>2025-07-11 23:24:46 +0200
commitf89f3d28a14d0d8ea8c02acf115c9c1c972b70cf (patch)
treedcc025a073007ce15221db73406041e9300f5957 /tests
parent43e3a8a08668b068eb07b5c1ee3aaa767021d3c0 (diff)
add read command. Improve tests
Diffstat (limited to 'tests')
-rwxr-xr-xtests19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests b/tests
index 50e1c75..a13cfdb 100755
--- a/tests
+++ b/tests
@@ -2,7 +2,6 @@
# Test suite for mp.
run() {
- # shellcheck disable=SC2254
[ "$filter" ] && case $1 in ($filter) ;; (*) return; esac
out=$(echo "$2" | ./mp 2>&1)
[ "$out" = "$3" ] && pass=$((pass + 1)) && return
@@ -15,12 +14,14 @@ run() {
pass=0 fail=0 filter="$1"
trap 'echo "$pass passed, $fail failed"; exit $((fail))' EXIT
-run basic1 'parse' ''
-run basic2 'parse null' 'null'
-run basic3 'parse true' 'true'
-run basic4 'parse false' 'false'
-run num1 'parse 12' '12'
-run str1 'parse "hello"' '"hello"'
-run obj1 'parse {}' '{}'
-run arr1 'parse []' '[]'
+run basic1 "parse\nformat" ''
+run basic2 'parse null\nformat' 'null'
+run basic3 'parse true\nformat' 'true'
+run basic4 'parse false\nformat' 'false'
+run num1 'parse 12\nformat' '12'
+run str1 'parse "hello"\nformat' '"hello"'
+run arr1 'parse []\nformat' '[]'
+run arr2 'parse [null]\nformat' '[null]'
+run arr3 'parse [true,false]\nformat' '[true,false]'
+run obj1 'parse {}\nformat' '{}'