mirror of
https://github.com/qemu/qemu.git
synced 2024-11-27 13:53:45 +08:00
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>
This commit is contained in:
parent
ef91ab0d5f
commit
4d42815587
@ -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
|
||||
|
@ -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': { } }
|
||||
|
1
tests/qapi-schema/funny-word.err
Normal file
1
tests/qapi-schema/funny-word.err
Normal file
@ -0,0 +1 @@
|
||||
tests/qapi-schema/funny-word.json:1:3: Stray "c"
|
1
tests/qapi-schema/funny-word.exit
Normal file
1
tests/qapi-schema/funny-word.exit
Normal file
@ -0,0 +1 @@
|
||||
1
|
1
tests/qapi-schema/funny-word.json
Normal file
1
tests/qapi-schema/funny-word.json
Normal file
@ -0,0 +1 @@
|
||||
{ command: 'foo' }
|
0
tests/qapi-schema/funny-word.out
Normal file
0
tests/qapi-schema/funny-word.out
Normal file
Loading…
Reference in New Issue
Block a user