summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/Makefile.am3
-rw-r--r--test/data/entities.plist57
-rwxr-xr-xtest/entities.test12
3 files changed, 71 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 7113a55..f100e54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -31,9 +31,10 @@ TESTS = \
hex.test \
order.test \
recursion.test \
+ entities.test \
malformed_dict.test
-EXTRA_DIST = $(TESTS) data/1.plist data/2.plist data/3.plist data/4.plist data/5.plist data/6.plist data/7.plist data/signed.plist data/signed.bplist data/unsigned.plist data/unsigned.bplist data/hex.plist data/order.bplist data/recursion.bplist data/malformed_dict.bplist
+EXTRA_DIST = $(TESTS) data/1.plist data/2.plist data/3.plist data/4.plist data/5.plist data/6.plist data/7.plist data/signed.plist data/signed.bplist data/unsigned.plist data/unsigned.bplist data/hex.plist data/order.bplist data/recursion.bplist data/entities.plist data/malformed_dict.bplist
TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir)
diff --git a/test/data/entities.plist b/test/data/entities.plist
new file mode 100644
index 0000000..d7655d6
--- /dev/null
+++ b/test/data/entities.plist
@@ -0,0 +1,57 @@
+<plist version="1.0">
+<dict>
+ <key>some test entitites</key>
+ <dict>
+ <key>copyright</key>
+ <string>&#169;</string>
+ <key>multiple entitites</key>
+ <string>&#x2F20;&#x2F21;&#x2F22;</string>
+ <key>multiple entitites with characters inbetween</key>
+ <string>a&#x2F23;b&#x2F24;c&#x2F25;d</string>
+ </dict>
+ <key>one byte entity</key>
+ <dict>
+ <key>one byte entity</key>
+ <string>&#64;</string>
+ <key>one byte entity with text after</key>
+ <string>&#x40;z</string>
+ <key>one byte entity with text before</key>
+ <string>a&#x40;</string>
+ <key>one byte entity with text before &amp; after</key>
+ <string>a&#64;z</string>
+ </dict>
+ <key>two-byte utf-8</key>
+ <dict>
+ <key>two-byte utf-8</key>
+ <string>&#xC4;</string>
+ <key>two-byte utf-8 with text after</key>
+ <string>&#xCB;yz</string>
+ <key>two-byte utf-8 with text before</key>
+ <string>ab&#xD6;</string>
+ <key>two-byte utf-8 with text before &amp; after</key>
+ <string>ab&#xDC;yz</string>
+ </dict>
+ <key>three byte utf-8</key>
+ <dict>
+ <key>three byte utf-8</key>
+ <string>&#xFFE0;</string>
+ <key>three byte utf-8 with text after</key>
+ <string>&#65505;xyz</string>
+ <key>three byte utf-8 with text before</key>
+ <string>abc&#xFFE5;</string>
+ <key>three byte utf-8 with text before &amp; after</key>
+ <string>abc&#65510;xyz</string>
+ </dict>
+ <key>four byte utf-8</key>
+ <dict>
+ <key>four byte utf-8</key>
+ <string>&#x1D562;</string>
+ <key>four byte utf-8 with text after</key>
+ <string>&#x1D563;wxyz</string>
+ <key>four byte utf-8 with text before</key>
+ <string>abcd&#x1D564;</string>
+ <key>four byte utf-8 with text before &amp; after</key>
+ <string>abcd&#x1D565;wxyz</string>
+ </dict>
+</dict>
+</plist>
diff --git a/test/entities.test b/test/entities.test
new file mode 100755
index 0000000..b87e4c7
--- /dev/null
+++ b/test/entities.test
@@ -0,0 +1,12 @@
+## -*- sh -*-
+
+set -e
+
+DATASRC=$top_srcdir/test/data
+TESTFILE=entities.plist
+DATAIN0=$DATASRC/$TESTFILE
+DATAOUT0=$top_builddir/test/data/$TESTFILE.bin
+
+$top_builddir/tools/plistutil -i $DATAIN0 -o $DATAOUT0
+
+$top_builddir/test/plist_cmp $DATAIN0 $DATAOUT0