add lexer test cases (#76)

This commit is contained in:
tersec 2024-01-15 07:02:08 +00:00 committed by GitHub
parent 0db6307eb3
commit 42253591b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
# json-serialization # json-serialization
# Copyright (c) 2019-2023 Status Research & Development GmbH # Copyright (c) 2019-2024 Status Research & Development GmbH
# Licensed under either of # Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT)) # * MIT license ([LICENSE-MIT](LICENSE-MIT))
@ -882,3 +882,14 @@ suite "lexer test suite":
testScanValue("{123:true}", JsonValueRef[uint64](kind: JsonValueKind.Object), error = errStringExpected) testScanValue("{123:true}", JsonValueRef[uint64](kind: JsonValueKind.Object), error = errStringExpected)
testScanValue("{\"123:true}", "{\"123:true}", error = errUnexpectedEof) testScanValue("{\"123:true}", "{\"123:true}", error = errUnexpectedEof)
testScanValue("{\"123\":\"tru", "{\"123\":\"tru\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"tr", "{\"123\":\"tr\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"t", "{\"123\":\"t\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"nul", "{\"123\":\"nul\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"nu", "{\"123\":\"nu\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"n", "{\"123\":\"n\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"fals", "{\"123\":\"fals\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"fal", "{\"123\":\"fal\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"fa", "{\"123\":\"fa\"", error = errUnexpectedEof)
testScanValue("{\"123\":\"f", "{\"123\":\"f\"", error = errUnexpectedEof)