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>
master
Markus Armbruster 2019-09-14 17:34:53 +02:00
parent ef91ab0d5f
commit 4d42815587
6 changed files with 5 additions and 1 deletions

View File

@ -402,6 +402,7 @@ qapi-schema += flat-union-no-base.json
qapi-schema += flat-union-optional-discriminator.json
qapi-schema += flat-union-string-discriminator.json
qapi-schema += funny-char.json
qapi-schema += funny-word.json
qapi-schema += ident-with-escape.json
qapi-schema += include-before-err.json
qapi-schema += include-cycle.json

View File

@ -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': { } }

View File

@ -0,0 +1 @@
tests/qapi-schema/funny-word.json:1:3: Stray "c"

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1 @@
{ command: 'foo' }

View File