forked from aniani/vim
patch 8.2.4695: JSON encoding could be faster
Problem: JSON encoding could be faster. Solution: Optimize encoding JSON strings. (closes #10086)
This commit is contained in:
@@ -107,6 +107,9 @@ func Test_json_encode()
|
||||
call assert_equal('"café"', json_encode("caf\xe9"))
|
||||
let &encoding = save_encoding
|
||||
|
||||
" Invalid utf-8 sequences are replaced with U+FFFD (replacement character)
|
||||
call assert_equal('"foo' . "\ufffd" . '"', json_encode("foo\xAB"))
|
||||
|
||||
call assert_fails('echo json_encode(function("tr"))', 'E1161: Cannot json encode a func')
|
||||
call assert_fails('echo json_encode([function("tr")])', 'E1161: Cannot json encode a func')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user