aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/json_functions_spec.lua
Commit message (Collapse)AuthorAge
* test: reorg #15698Justin M. Keyes2021-09-17
| | | | | | | | | | | | | | | | | | | | Problem: Subdirectories like "visual", "insert", "normal" encourage people to separate *related* tests for no good reason. Typically the _mode_ is not the relevant topic of a test (and when it is, _then_ create an appropriate describe() or it()). Solution: - Delete the various `test/functional/<mode>/` subdirectories, move their tests to more meaningful topics. - Rename `…/normal/` to `…/editor/`. - Move or merge `…/visual/*` and `…/insert/*` tests into here where appropriate. - Rename `…/eval/` to `…/vimscript/`. - Move `…/viml/*` into here also. * test(reorg): insert/* => editor/mode_insert_spec.lua * test(reorg): cmdline/* => editor/mode_cmdline_spec.lua * test(reorg): eval core tests => eval_spec.lua
* feat(json): convert Blobs to array of byte valuesSean Dewar2021-09-15
| | | | | Similiar to how Vim does it, but to be consistent with how Nvim encodes lists, add a space after every comma.
* eval/decode.c: Avoid NULL arg to memchr() #7332Adrian Neumann2017-11-06
| | | | | | | Clang complains because memchr has undefined behavior if the ptr is NULL, even if len==0. Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
* functests: Replace execute with either command or feed_commandZyX2017-04-09
| | | | | | | | | | Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed.
* tests: Add tests for partials dumpingZyX2017-01-03
| | | | | Also fixed dumping of partials by encode_vim_to_object and added code which is able to work with partials and dictionaries to test/unit/eval/helpers.lua (mostly copied from #5119, except for partials handling).
* encoding: update testsBjörn Linse2016-11-05
| | | | | | | Change shada reencoding tests to check for correct handling of UTF-8 and binary strings. Delete enc=latin1 json tests.
* test: fix command_count_specBjörn Linse2016-06-23
| | | | The test hit wait_return if x or .x.swp exists in the project root directory.
* functests: Check logs in lua codeZyX2016-06-10
| | | | | | It is otherwise impossible to determine which test failed sanitizer/valgrind check. test/functional/helpers.lua module return was changed so that tests which do not provide after_each function to get new check will automatically fail.
* Satisfy testlint.KillTheMule2016-04-28
| | | | For that, make luatest ignore the preload.lua files.
* functests: Make json_functions_spec use new NIL where appropriateZyX2016-04-18
|
* eval/encode: Make sure that encoder can encode NULL variablesZyX2016-04-18
| | | | | | | | | Adds two undocumented v: variables: _null_list and _null_dict because I do not know a reproducible way to get such lists (though I think I heard about this) and dictionaries (do not remember hearing about them). NULL strings are obtained using $XXX_UNEXISTENT_VAR_XXX. Fixes crash in json_encode($XXX_UNEXISTENT_VAR_XXX). Other added tests worked fine before this commit.
* functests: Replace \xXX escapes with \DDD in lua codeZyX2016-04-18
|
* eval/encode: Dump FF character correctlyZyX2016-04-18
|
* eval: Treat [] and [""] as any other empty stringZyX2016-04-18
|
* eval: Fix overflow in error message in f_json_decodeZyX2016-04-18
|
* documentation,functests: State that UTF-8-only support is intentionalZyX2016-04-18
|
* eval/decode: Accept `\r` as space characterZyX2016-04-18
|
* eval/decode: Reject even more numbersZyX2016-04-18
| | | | Rejects leading zeroes and numbers like 1.e+5 (decimal dot with missing number with signed exponent).
* eval/decode: Reject more numbers, accept 1e5ZyX2016-04-18
|
* eval/decode: Do not loose high surrogates followed by high surrogatesZyX2016-04-18
|
* eval/decode: Make sure that error messages do not cause overflowZyX2016-04-18
|
* eval/decode: Make sure that blank input does not crash NeovimZyX2016-04-18
|
* eval/decode: Make sure that U+00C3 is parsed correctlyZyX2016-04-18
|
* functests: Make sure that json functions are tested with C messagesZyX2016-04-18
|
* eval/decode: Rename brackets in error messagesZyX2016-04-18
| | | | | U+007D is officially RIGHT CURLY BRACKET. U+005D is officially RIGHT SQUARE BRACKET.
* encode: Handle incomplete surrogates like `\uSURR\uOTHR` properlyZyX2016-04-18
|
* encode: Fail to dump NaN and infinityZyX2016-04-18
| | | | Thanks to vim/vim#654
* eval: Rename json* functions to json_*ZyX2016-04-18
|
* eval/encode: Fix invalid UTF-8 strings handling:ZyX2016-04-18
| | | | 1. Do not allow reading past buffer end when creating error messages. 2. Fix surrogate pairs range, avoid magic constants.
* eval/encode: Fix non-utf-8 &encoding handling, add testsZyX2016-04-18
|
* eval/decode: Add support for special mapsZyX2016-04-18
| | | | | | | Special dictionaries representing map are created when encountering duplicate key or when key is empty or contains NUL. Also checks that values are separated by a comma/colon properly.
* eval/decode: Parse strings with NUL to special dictionariesZyX2016-04-18
|
* eval/decode: Fix surrogate pairs processingZyX2016-04-18
|
* eval/decode: Fail on control and invalid unicode charactersZyX2016-04-18
|
* eval: Add jsondecode() functionZyX2016-04-18
|
* eval: Add jsonencode() functionZyX2016-04-18
Ref #3471