aboutsummaryrefslogtreecommitdiff
path: root/test/testdata
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2009-07-18 15:59:55 +0300
committerPetri Lehtinen <petri@digip.org>2009-07-26 11:31:25 +0300
commit20efe4aa261bb997dc5f5d64e51a5db20583f960 (patch)
treebbc0a35ce7af110af77b48b2f2fb1bb898386157 /test/testdata
parent9240146c102f97045836d33fa1a79b267a050172 (diff)
downloadjansson-20efe4aa261bb997dc5f5d64e51a5db20583f960.zip
jansson-20efe4aa261bb997dc5f5d64e51a5db20583f960.tar.gz
jansson-20efe4aa261bb997dc5f5d64e51a5db20583f960.tar.bz2
Expand parser and Unicode test coverage
Diffstat (limited to 'test/testdata')
-rw-r--r--test/testdata/invalid20
-rw-r--r--test/testdata/invalid-unicode89
-rw-r--r--test/testdata/valid2
3 files changed, 110 insertions, 1 deletions
diff --git a/test/testdata/invalid b/test/testdata/invalid
index 1871d85..41aa410 100644
--- a/test/testdata/invalid
+++ b/test/testdata/invalid
@@ -77,6 +77,11 @@ unexpected token near end of file
1
unexpected newline near '"a'
========
+{"a":"a" 123}
+====
+1
+'}' expected near '123'
+========
{[
====
1
@@ -132,6 +137,16 @@ invalid token near '0'
1
invalid token near '-0'
========
+[troo
+====
+1
+invalid token near 'troo'
+========
+["\a <-- invalid escape"]
+====
+1
+invalid escape near '"\'
+========
[" <-- tab character"]
====
1
@@ -156,3 +171,8 @@ invalid Unicode '\uD888\u3210'
====
1
invalid Unicode '\uDFAA'
+========
+====
+1
+'[' or '{' expected near 'å'
diff --git a/test/testdata/invalid-unicode b/test/testdata/invalid-unicode
new file mode 100644
index 0000000..fbc807d
--- /dev/null
+++ b/test/testdata/invalid-unicode
@@ -0,0 +1,89 @@
+
+====
+-1
+unable to decode byte 0xe5 at position 0
+========
+[" <-- invalid UTF-8"]
+====
+-1
+unable to decode byte 0xe5 at position 2
+========
+[]
+====
+-1
+unable to decode byte 0xe5 at position 1
+========
+[a]
+====
+-1
+unable to decode byte 0xe5 at position 2
+========
+["\u"]
+====
+-1
+unable to decode byte 0xe5 at position 4
+========
+["\"]
+====
+-1
+unable to decode byte 0xe5 at position 3
+========
+[0]
+====
+-1
+unable to decode byte 0xe5 at position 2
+========
+[123]
+====
+-1
+unable to decode byte 0xe5 at position 4
+========
+[1e]
+====
+-1
+unable to decode byte 0xe5 at position 3
+========
+[1e1]
+====
+-1
+unable to decode byte 0xe5 at position 4
+========
+[""]
+====
+-1
+unable to decode byte 0x81 at position 2
+========
+[""]
+====
+-1
+unable to decode byte 0xc1 at position 2
+========
+[""]
+====
+-1
+unable to decode byte 0xfd at position 2
+========
+[""]
+====
+-1
+unable to decode byte 0xf4 at position 2
+========
+[" <-- overlong encoding"]
+====
+-1
+unable to decode byte 0xe0 at position 2
+========
+[" <-- overlong encoding"]
+====
+-1
+unable to decode byte 0xf0 at position 2
+========
+[" <-- truncated UTF-8"]
+====
+-1
+unable to decode byte 0xe0 at position 2
+========
+[" <-- encoded surrogate half"]
+====
+-1
+unable to decode byte 0xed at position 2
diff --git a/test/testdata/valid b/test/testdata/valid
index ebe7f95..755b393 100644
--- a/test/testdata/valid
+++ b/test/testdata/valid
@@ -4,7 +4,7 @@
========
["abcdefghijklmnopqrstuvwxyz1234567890 "]
========
-["€þıœəßð some utf-8 ĸʒ×ŋµåäö"]
+["€þıœəßð some utf-8 ĸʒ×ŋµåäö𝄞"]
========
["\"\\\/\b\f\n\r\t"]
========