diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 829295ea..40ae8ec8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -66,6 +66,7 @@ add_jsonschema_test_unix(validate/fail_draft7) add_jsonschema_test_unix(validate/fail_2019_09) add_jsonschema_test_unix(validate/fail_2020_12) add_jsonschema_test_unix(validate/pass_jsonl) +add_jsonschema_test_unix(validate/pass_jsonl_empty) add_jsonschema_test_unix(validate/pass_jsonl_verbose) add_jsonschema_test_unix(validate/fail_jsonl_invalid_entry) add_jsonschema_test_unix(validate/fail_jsonl_one) diff --git a/test/validate/pass_jsonl_empty.sh b/test/validate/pass_jsonl_empty.sh new file mode 100755 index 00000000..f536a6fa --- /dev/null +++ b/test/validate/pass_jsonl_empty.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -o errexit +set -o nounset + +TMP="$(mktemp -d)" +clean() { rm -rf "$TMP"; } +trap clean EXIT + +cat << 'EOF' > "$TMP/schema.json" +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "properties": { + "foo": { + "type": "string" + } + } +} +EOF + +touch "$TMP/instance.jsonl" +"$1" validate "$TMP/schema.json" "$TMP/instance.jsonl"