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

json2: encode ascii chars < 0x20 in json (#12494)

This commit is contained in:
Don Park
2021-11-17 21:34:00 -08:00
committed by GitHub
parent 26fbf1885d
commit ae54cd78f5
3 changed files with 17 additions and 0 deletions

View File

@ -5,6 +5,13 @@ fn test_raw_decode_string() ? {
assert str.str() == 'Hello!'
}
fn test_raw_decode_string_escape() ? {
jstr := raw_decode('"\u001b"') ?
str := jstr.str()
assert str.len == 1
assert str[0] == 27
}
fn test_raw_decode_number() ? {
num := raw_decode('123') ?
assert num.int() == 123