summaryrefslogtreecommitdiff
path: root/test/libyaml-parser.t
diff options
context:
space:
mode:
authorIngy döt Net <ingy@ingy.net>2020-05-25 21:42:19 -0700
committerIngy döt Net <ingy@ingy.net>2020-05-25 22:24:14 -0700
commitf2d7db65e551b4231b6bc4c1ac80d9ffaa638ea6 (patch)
treedbaab114adc8f188908b2b10a5707fb20860d0c5 /test/libyaml-parser.t
downloadlibyaml-git-testing.tar.gz
Initial committesting
Diffstat (limited to 'test/libyaml-parser.t')
-rw-r--r--test/libyaml-parser.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/libyaml-parser.t b/test/libyaml-parser.t
new file mode 100644
index 0000000..5e9cb94
--- /dev/null
+++ b/test/libyaml-parser.t
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+# shellcheck disable=1090,2034
+
+root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
+
+source "$root"/test/test-runner.bash
+
+check-test() {
+ id=$1
+ t=data/$id
+
+ grep "$id" "$root/blacklist/libyaml-parser" >/dev/null && return 1
+ [[ -e $t/error ]] && return 1
+
+ return 0
+}
+
+run-test() {
+ dir=$1
+ ok=true
+
+ libyaml/tests/run-parser-test-suite "$dir/in.yaml" > /tmp/test.out || {
+ (
+ cat "$dir/in.yaml"
+ cat "$dir/test.event"
+ ) | sed 's/^/# /'
+ }
+
+ output=$(${DIFF:-diff} -u "$dir/test.event" /tmp/test.out) || ok=false
+}
+
+run-tests "$@"