summaryrefslogtreecommitdiffstats
path: root/tests/qapi-schema
diff options
context:
space:
mode:
authorMarkus Armbruster2019-09-14 17:34:53 +0200
committerMarkus Armbruster2019-09-24 14:07:23 +0200
commit4d42815587063d6e544c4e6a2e3240516f44dcc9 (patch)
tree8e1842a713cd900ae752d5e018a25a90f3fc34c4 /tests/qapi-schema
parenttests/qapi-schema: Demonstrate insufficient 'if' checking (diff)
downloadqemu-4d42815587063d6e544c4e6a2e3240516f44dcc9.tar.gz
qemu-4d42815587063d6e544c4e6a2e3240516f44dcc9.tar.xz
qemu-4d42815587063d6e544c4e6a2e3240516f44dcc9.zip
tests/qapi-schema: Demonstrate suboptimal lexical errors
The error message for forgotten quotes around a name shows just the name's first character, which isn't as nice as it could be. Same for attempting to use a number. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190914153506.2151-7-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qapi-schema')
-rw-r--r--tests/qapi-schema/bad-type-int.json2
-rw-r--r--tests/qapi-schema/funny-word.err1
-rw-r--r--tests/qapi-schema/funny-word.exit1
-rw-r--r--tests/qapi-schema/funny-word.json1
-rw-r--r--tests/qapi-schema/funny-word.out0
5 files changed, 4 insertions, 1 deletions
diff --git a/tests/qapi-schema/bad-type-int.json b/tests/qapi-schema/bad-type-int.json
index 56fc6f8126..f3ad803cb6 100644
--- a/tests/qapi-schema/bad-type-int.json
+++ b/tests/qapi-schema/bad-type-int.json
@@ -1,3 +1,3 @@
# we reject an expression with a metatype that is not a string
# FIXME: once the parser understands integer inputs, improve the error message
-{ 'struct': 1, 'data': { } }
+{ 'struct': 123, 'data': { } }
diff --git a/tests/qapi-schema/funny-word.err b/tests/qapi-schema/funny-word.err
new file mode 100644
index 0000000000..0a440574bd
--- /dev/null
+++ b/tests/qapi-schema/funny-word.err
@@ -0,0 +1 @@
+tests/qapi-schema/funny-word.json:1:3: Stray "c"
diff --git a/tests/qapi-schema/funny-word.exit b/tests/qapi-schema/funny-word.exit
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/qapi-schema/funny-word.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/qapi-schema/funny-word.json b/tests/qapi-schema/funny-word.json
new file mode 100644
index 0000000000..1153b9f12f
--- /dev/null
+++ b/tests/qapi-schema/funny-word.json
@@ -0,0 +1 @@
+{ command: 'foo' }
diff --git a/tests/qapi-schema/funny-word.out b/tests/qapi-schema/funny-word.out
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/qapi-schema/funny-word.out