1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

x.json2: create custom scanner for scanning JSON (#8716)

This commit is contained in:
Ned Palacios
2021-02-26 14:36:02 +08:00
committed by GitHub
parent 7bee3dc489
commit 8dff168e01
8 changed files with 730 additions and 372 deletions

View File

@@ -54,8 +54,16 @@ fn test_raw_decode_null() {
fn test_raw_decode_invalid() {
json2.raw_decode('1z') or {
assert err == '[json] invalid JSON. (0:0)'
assert err == '[x.json2] invalid token `z` (0:17)'
return
}
assert false
}
fn test_raw_decode_string_with_dollarsign() {
str := json2.raw_decode(r'"Hello $world"') or {
assert false
json2.Any{}
}
assert str.str() == r'Hello $world'
}