aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/writefile_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
* vim-patch:8.2.0404: writefile() error does not give a hintSean Dewar2021-09-15
| | | | | | Problem: Writefile() error does not give a hint. Solution: Add remark about first argument. https://github.com/vim/vim/commit/18a2b87ca27c378a555b20f14a284d2ce3511427
* vim-patch:8.1.0735: cannot handle binary dataSean Dewar2021-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot handle binary data. Solution: Add the Blob type. (Yasuhiro Matsumoto, closes vim/vim#3638) https://github.com/vim/vim/commit/6e5ea8d2a995b32bbc5972edc4f827b959f2702f Nvim-specific Blob conversions are implemented in future commits. Refactor write_blob() to use a FileDescriptor, as f_writefile() was refactored to use one (does not apply to read_blob()). Use var_check_lock() in f_add() for Blobs from v8.1.0897. Add a modeline to test_blob.vim and fix some doc typos. Include if_perl.txt's VIM::Blob() documentation. Interestingly, this function already worked before this port, as it just returns a Blob string literal, not an actual Blob object. N/A patches for version.c: vim-patch:8.1.0741: viminfo with Blob is not tested Problem: Viminfo with Blob is not tested. Solution: Extend the viminfo test. Fix reading a blob. Fixed storing a special variable value. https://github.com/vim/vim/commit/8c8b8bb56c724cc1bfc3d8520eec33f2d399697c vim-patch:8.1.1022: may use NULL pointer when out of memory Problem: May use NULL pointer when out of memory. (Coverity) Solution: Check for blob_alloc() returning NULL. https://github.com/vim/vim/commit/e142a9467a7f6845a426d8db6efedf246d3c13ac
* eval: add v:_null_stringJan Edmund Lazo2021-04-08
| | | | | | | | | | Replacement for Vim's test_null_string(). Vim uses it to verify that its codebase handles null strings. Preparation for the Test_null_list() in patch v8.2.1822. Use v:_null_string, not non-existent env var, for null string tests. Mention v:_null_string in id() because id(v:_null_string) returns (nil).
* test: update writefile test for invalid list itemsJan Edmund Lazo2018-06-24
| | | | | | It validates list items with tv_check_str_on_nr() to catch invalid types (ex. E745, E805). If there is an invalid item, it does not write to the file.
* eval: Add s flag, use p_fs by default, error out on unknown flagZyX2017-04-03
|
* eval: Fix error messages from writefileZyX2017-02-14
| | | | | | | | | | | | | | 1. When calling writefile(list, fname, []) do not show error message twice. 2. Do not allow file name to be overwritten for writefile([1], 2). 3. Do not show “Can’t open file with an empty name” error after error like “using Float as a String” when type of the second argument is not correct. 4. Do not give multiple error messages and still continue for code like `writefile(["test", [], [], [], "tset"])`. Note that to fix 4. ideally I need tv_check_str_or_nr which is currently present in two PRs: #6114 and #5119. I would want to avoid copying this function into a yet another PR. Ref vim/vim#1476.
* eval: writefile: Give more adequate IO errors and do not call putc()ZyX2017-02-14