mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
unittests: Do not alter p_enc in decode unit test
This commit is contained in:
@@ -72,7 +72,7 @@ describe('json_decode_string()', function()
|
||||
end
|
||||
|
||||
itp('does not overflow in error messages', function()
|
||||
local saved_p_enc = decode.p_enc
|
||||
collectgarbage('restart')
|
||||
check_failure(']test', 1, 'E474: No container to close: ]')
|
||||
check_failure('[}test', 2, 'E474: Closing list with curly bracket: }')
|
||||
check_failure('{]test', 2,
|
||||
@@ -105,10 +105,6 @@ describe('json_decode_string()', function()
|
||||
check_failure('"\194"test', 3, 'E474: Only UTF-8 strings allowed: \194"')
|
||||
check_failure('"\252\144\128\128\128\128"test', 8, 'E474: Only UTF-8 code points up to U+10FFFF are allowed to appear unescaped: \252\144\128\128\128\128"')
|
||||
check_failure('"test', 1, 'E474: Expected string end: "')
|
||||
decode.p_enc = to_cstr('latin1')
|
||||
check_failure('"\\uABCD"test', 8,
|
||||
'E474: Failed to convert string "ꯍ" from UTF-8')
|
||||
decode.p_enc = saved_p_enc
|
||||
check_failure('-test', 1, 'E474: Missing number after minus sign: -')
|
||||
check_failure('-1.test', 3, 'E474: Missing number after decimal dot: -1.')
|
||||
check_failure('-1.0etest', 5, 'E474: Missing exponent: -1.0e')
|
||||
|
||||
Reference in New Issue
Block a user