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:
@@ -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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user