test utf8

This commit is contained in:
dota17
2020-01-08 19:42:05 +08:00
parent e651e96a5b
commit eca74dcccf
4 changed files with 111 additions and 3 deletions

View File

@@ -183,5 +183,29 @@ json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got object of type [array]
json_tokener_parse_ex(tok, [1,2,,3,] , 9) ... OK: got correct error: unexpected character
json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got correct error: unexpected character
json_tokener_parse_ex(tok, {"a":1,} , 8) ... OK: got correct error: unexpected character
End Incremental Tests OK=105 ERROR=0
json_tokener_parse_ex(tok, "123asc$%&" , 11) ... OK: got object of type [string]: "123asc$%&"
json_tokener_parse_ex(tok, "123asc$%&" , 11) ... OK: got object of type [string]: "123asc$%&"
json_tokener_parse_ex(tok, "世界" , 8) ... OK: got object of type [string]: "世界"
json_tokener_parse_ex(tok, "<22><> , 3) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, <20>界" , 5) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, "世界" , 8) ... OK: got object of type [string]: "世界"
json_tokener_parse_ex(tok, "πφ" , 6) ... OK: got object of type [string]: "πφ"
json_tokener_parse_ex(tok, "𥑕" , 6) ... OK: got object of type [string]: "𥑕"
json_tokener_parse_ex(tok, "<22><><EFBFBD><EFBFBD><EFBFBD>" , 7) ... OK: got object of type [string]: "<22><><EFBFBD><EFBFBD><EFBFBD>"
json_tokener_parse_ex(tok, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" , 8) ... OK: got object of type [string]: "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
json_tokener_parse_ex(tok, "<22><>N" , 5) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, "<22><>N" , 5) ... OK: got object of type [string]: "<22><>N"
json_tokener_parse_ex(tok, "<22><><EFBFBD><EFBFBD>" , 6) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, "<22><><EFBFBD><EFBFBD>" , 6) ... OK: got object of type [string]: "<22><><EFBFBD><EFBFBD>"
json_tokener_parse_ex(tok, "世" , 7) ... OK: got object of type [string]: "世"
json_tokener_parse_ex(tok, <20>"世" , 8) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, [ <20>1] , 5) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, Infinity , 9) ... OK: got object of type [double]: Infinity
json_tokener_parse_ex(tok, Inf<6E>nity , 8) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, "\ud855\udc55", 15) ... OK: got object of type [string]: "𥑕"
json_tokener_parse_ex(tok, "\ud855<35>udc55", 14) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, "\ud0031<33>" , 10) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, 11<31>11 , 5) ... OK: got correct error: invalid utf-8 string
json_tokener_parse_ex(tok, {"1<>":1} , 8) ... OK: got correct error: invalid utf-8 string
End Incremental Tests OK=129 ERROR=0
==================================