From 9f03f8aabcd036c1a97d9cfb6330409127202102 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 2 Jan 2017 02:08:02 +0100 Subject: test: Add new test case for dictionaries with empty keys --- test/Makefile.am | 3 ++- test/data/empty_keys.plist | 8 ++++++++ test/empty_keys.test | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/data/empty_keys.plist create mode 100755 test/empty_keys.test diff --git a/test/Makefile.am b/test/Makefile.am index f100e54..6f43929 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -32,9 +32,10 @@ TESTS = \ order.test \ recursion.test \ entities.test \ + empty_keys.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/entities.plist 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/empty_keys.plist data/malformed_dict.bplist TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) diff --git a/test/data/empty_keys.plist b/test/data/empty_keys.plist new file mode 100644 index 0000000..a0107b4 --- /dev/null +++ b/test/data/empty_keys.plist @@ -0,0 +1,8 @@ + + + + empty key + + empty key with comment + + diff --git a/test/empty_keys.test b/test/empty_keys.test new file mode 100755 index 0000000..4291e8c --- /dev/null +++ b/test/empty_keys.test @@ -0,0 +1,12 @@ +## -*- sh -*- + +set -e + +DATASRC=$top_srcdir/test/data +TESTFILE=empty_keys.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 -- cgit v1.1-32-gdbae