Skip to content

Commit

Permalink
add lexer test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Jan 15, 2024
1 parent 0db6307 commit 3f655d0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_lexer.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# json-serialization
# Copyright (c) 2019-2023 Status Research & Development GmbH
# Copyright (c) 2019-2024 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
Expand Down Expand Up @@ -882,3 +882,14 @@ suite "lexer test suite":
testScanValue("{123:true}", JsonValueRef[uint64](kind: JsonValueKind.Object), error = errStringExpected)

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)

0 comments on commit 3f655d0

Please sign in to comment.