summaryrefslogtreecommitdiffstats
path: root/test/json-invalid-types.test
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-12-23 03:09:07 +0100
committerGravatar Nikias Bassen2021-12-23 03:09:07 +0100
commit429cbc660ae14d4998715803b44c71abf0e4a339 (patch)
tree12fe08f5dcb00a380536198bac3fffd4eb7dd19b /test/json-invalid-types.test
parent70002721443dabaa99b56301b537980e137b6249 (diff)
downloadlibplist-429cbc660ae14d4998715803b44c71abf0e4a339.tar.gz
libplist-429cbc660ae14d4998715803b44c71abf0e4a339.tar.bz2
Add support for JSON format
Diffstat (limited to 'test/json-invalid-types.test')
-rwxr-xr-xtest/json-invalid-types.test36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/json-invalid-types.test b/test/json-invalid-types.test
new file mode 100755
index 0000000..0397c05
--- /dev/null
+++ b/test/json-invalid-types.test
@@ -0,0 +1,36 @@
+## -*- sh -*-
+
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE0=data.bplist
+TESTFILE1=7.plist
+TESTFILE2=uid.bplist
+
+if ! test -d "$DATAOUT"; then
+ mkdir -p $DATAOUT
+fi
+
+export PLIST_JSON_DEBUG=1
+
+echo "Converting (failure expected)"
+STDERR=`$top_builddir/tools/plistutil -f json -i $DATASRC/$TESTFILE0 -o /dev/null 2>&1`
+echo "$STDERR"
+if ! echo "$STDERR" |grep "PLIST_DATA type is not valid for JSON format"; then
+ exit 1
+fi
+
+echo "Converting (failure expected)"
+STDERR=`$top_builddir/tools/plistutil -f json -i $DATASRC/$TESTFILE1 -o /dev/null 2>&1`
+echo "$STDERR"
+if ! echo "$STDERR" |grep "PLIST_DATE type is not valid for JSON format"; then
+ exit 2
+fi
+
+echo "Converting (failure expected)"
+STDERR=`$top_builddir/tools/plistutil -f json -i $DATASRC/$TESTFILE2 -o /dev/null 2>&1`
+echo "$STDERR"
+if ! echo "$STDERR" |grep "PLIST_UID type is not valid for JSON format"; then
+ exit 3
+fi
+
+exit 0