summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/Makefile.am1
-rw-r--r--test/data/j2.plist1
-rwxr-xr-xtest/json2.test11
-rwxr-xr-xtest/json3.test22
4 files changed, 28 insertions, 7 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index b70a85d..a75644a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -52,6 +52,7 @@ TESTS = \
52 uid.test \ 52 uid.test \
53 json1.test \ 53 json1.test \
54 json2.test \ 54 json2.test \
55 json3.test \
55 json-invalid-types.test 56 json-invalid-types.test
56 57
57EXTRA_DIST = \ 58EXTRA_DIST = \
diff --git a/test/data/j2.plist b/test/data/j2.plist
new file mode 100644
index 0000000..9d1210e
--- /dev/null
+++ b/test/data/j2.plist
@@ -0,0 +1 @@
{"Some ASCII string":"Test ASCII String","Some UTF8 strings":["àéèçù","日本語","汉语/漢語","한국어/조선말","русский язык","الْعَرَبيّة","עִבְרִית","język polski","हिन्दी"],"Keys & \"entities\"":"hellow world & others <nodes> are \"fun!?'","Boolean":false,"Another Boolean":true,"Some Int":32434543632,"Some String with Unicode entity":"Yeah check this: \u1234 !!!"} \ No newline at end of file
diff --git a/test/json2.test b/test/json2.test
index 06a7007..1329016 100755
--- a/test/json2.test
+++ b/test/json2.test
@@ -4,7 +4,7 @@ set -e
4 4
5DATASRC=$top_srcdir/test/data 5DATASRC=$top_srcdir/test/data
6DATAOUT=$top_builddir/test/data 6DATAOUT=$top_builddir/test/data
7TESTFILE=entities.plist 7TESTFILE=j2.plist
8 8
9if ! test -d "$DATAOUT"; then 9if ! test -d "$DATAOUT"; then
10 mkdir -p $DATAOUT 10 mkdir -p $DATAOUT
@@ -12,11 +12,8 @@ fi
12 12
13export PLIST_JSON_DEBUG=1 13export PLIST_JSON_DEBUG=1
14 14
15echo "Converting input file to JSON" 15echo "Converting"
16$top_builddir/tools/plistutil -f json -i $DATASRC/$TESTFILE -o $DATASRC/$TESTFILE.json 16$top_builddir/test/plist_jtest $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
17
18echo "Converting to binary and back to JSON"
19$top_builddir/test/plist_jtest $DATASRC/$TESTFILE.json $DATAOUT/$TESTFILE.json.out
20 17
21echo "Comparing" 18echo "Comparing"
22$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.json.out 19$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/json3.test b/test/json3.test
new file mode 100755
index 0000000..06a7007
--- /dev/null
+++ b/test/json3.test
@@ -0,0 +1,22 @@
1## -*- sh -*-
2
3set -e
4
5DATASRC=$top_srcdir/test/data
6DATAOUT=$top_builddir/test/data
7TESTFILE=entities.plist
8
9if ! test -d "$DATAOUT"; then
10 mkdir -p $DATAOUT
11fi
12
13export PLIST_JSON_DEBUG=1
14
15echo "Converting input file to JSON"
16$top_builddir/tools/plistutil -f json -i $DATASRC/$TESTFILE -o $DATASRC/$TESTFILE.json
17
18echo "Converting to binary and back to JSON"
19$top_builddir/test/plist_jtest $DATASRC/$TESTFILE.json $DATAOUT/$TESTFILE.json.out
20
21echo "Comparing"
22$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.json.out