diff options
author | ZyX <kp-pav@yandex.ru> | 2016-03-20 23:24:53 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-04-18 02:48:20 +0300 |
commit | fd92e648ac206340752c420ad639f2a6dab2a579 (patch) | |
tree | b1d46674c76b37e9645b4d5d93685c35a0f946a5 /test/functional/eval/json_functions_spec.lua | |
parent | 494b1c9beef3755916048df29755d3d014902191 (diff) | |
download | rneovim-fd92e648ac206340752c420ad639f2a6dab2a579.tar.gz rneovim-fd92e648ac206340752c420ad639f2a6dab2a579.tar.bz2 rneovim-fd92e648ac206340752c420ad639f2a6dab2a579.zip |
eval/encode: Dump FF character correctly
Diffstat (limited to 'test/functional/eval/json_functions_spec.lua')
-rw-r--r-- | test/functional/eval/json_functions_spec.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/eval/json_functions_spec.lua b/test/functional/eval/json_functions_spec.lua index 0b1862fa8b..bdd3306993 100644 --- a/test/functional/eval/json_functions_spec.lua +++ b/test/functional/eval/json_functions_spec.lua @@ -779,4 +779,9 @@ describe('json_encode() function', function() eq('Vim(call):E474: UTF-8 string contains code point which belongs to a surrogate pair: \xED\xAF\xBF', exc_exec('call json_encode("\xED\xAF\xBF")')) end) + + it('dumps control characters as expected', function() + eq([["\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000B\f\r\u000E\u000F\u0010\u0011\u0012\u0013"]], + eval('json_encode({"_TYPE": v:msgpack_types.string, "_VAL": ["\n\1\2\3\4\5\6\7\8\9", "\11\12\13\14\15\16\17\18\19"]})')) + end) end) |