aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-01-24 12:47:06 +0100
committerm-holger <m-holger@kubitscheck.org>2023-02-01 15:01:57 +0100
commitcba1c352e3c4236205dc96de643e780abb3c7b64 (patch)
tree95ec48de3cb0e52b11cfda17361091a0d2d9739f /libtests
parentb6b4d3b299490966524ee5a1a8ecc03c267af0c8 (diff)
downloadqpdf-cba1c352e3c4236205dc96de643e780abb3c7b64.tar.zst
In JSONParser add lex_state ls_number_minus
Diffstat (limited to 'libtests')
-rw-r--r--libtests/libtests.testcov3
-rw-r--r--libtests/qtest/json_parse.test2
-rw-r--r--libtests/qtest/json_parse/bad-31.out2
-rw-r--r--libtests/qtest/json_parse/bad-41.json2
-rw-r--r--libtests/qtest/json_parse/bad-41.out1
-rw-r--r--libtests/qtest/json_parse/bad-42.json1
-rw-r--r--libtests/qtest/json_parse/bad-42.out1
7 files changed, 9 insertions, 3 deletions
diff --git a/libtests/libtests.testcov b/libtests/libtests.testcov
index 2ceef541..26cf2048 100644
--- a/libtests/libtests.testcov
+++ b/libtests/libtests.testcov
@@ -58,7 +58,6 @@ QPDFArgParser bad option for help 0
QPDFArgParser bad topic for help 0
QPDFArgParser invalid choice handler to unknown 0
JSON parse junk after object 0
-JSON parse decimal with no digits 0
JSON parse invalid keyword 0
JSON parse expected colon 0
JSON parse expected , or } 0
@@ -76,11 +75,11 @@ JSON parse duplicate point 0
JSON parse duplicate e 0
JSON parse unexpected sign 0
JSON parse numeric bad character 0
+JSON parse number minus no digits 0
JSON parse keyword bad character 0
JSON parse backslash bad character 0
JSON parse unterminated string 0
JSON parse leading zero 0
-JSON parse number no digits 0
JSON parse premature end of u 0
JSON parse bad hex after u 0
JSONHandler unhandled value 0
diff --git a/libtests/qtest/json_parse.test b/libtests/qtest/json_parse.test
index 112da0a9..7c64e3bd 100644
--- a/libtests/qtest/json_parse.test
+++ b/libtests/qtest/json_parse.test
@@ -121,6 +121,8 @@ my @bad = (
"high high surrogate", # 38
"dangling high surrogate", # 39
"duplicate dictionary key", # 40
+ "decimal point after minus",# 41
+ "e after minus", # 42
);
my $i = 0;
diff --git a/libtests/qtest/json_parse/bad-31.out b/libtests/qtest/json_parse/bad-31.out
index 344f42e8..2228d08d 100644
--- a/libtests/qtest/json_parse/bad-31.out
+++ b/libtests/qtest/json_parse/bad-31.out
@@ -1 +1 @@
-exception: bad-31.json: JSON: offset 2: number with no digits
+exception: bad-31.json: JSON: offset 1: numeric literal: no digit after minus sign
diff --git a/libtests/qtest/json_parse/bad-41.json b/libtests/qtest/json_parse/bad-41.json
new file mode 100644
index 00000000..dad59049
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-41.json
@@ -0,0 +1,2 @@
+-.123
+
diff --git a/libtests/qtest/json_parse/bad-41.out b/libtests/qtest/json_parse/bad-41.out
new file mode 100644
index 00000000..bebcfdb9
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-41.out
@@ -0,0 +1 @@
+exception: bad-41.json: JSON: offset 1: numeric literal: no digit after minus sign
diff --git a/libtests/qtest/json_parse/bad-42.json b/libtests/qtest/json_parse/bad-42.json
new file mode 100644
index 00000000..2f9148b0
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-42.json
@@ -0,0 +1 @@
+-e123
diff --git a/libtests/qtest/json_parse/bad-42.out b/libtests/qtest/json_parse/bad-42.out
new file mode 100644
index 00000000..96e9a0a3
--- /dev/null
+++ b/libtests/qtest/json_parse/bad-42.out
@@ -0,0 +1 @@
+exception: bad-42.json: JSON: offset 1: numeric literal: no digit after minus sign