aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/fnamemodify_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
* fnamemodify: fix handling of :r after :e #11165Rob Pilling2019-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Test fnamemodify() - Test handling of `expand("%:e:e:r")`. - Fix :e:e:r on filenames with insufficiently many extensions During `fnamemodify()`, ensuring that we don't go before the filename's tail is insufficient in cases where we've already handled a ":e" modifier, for example: ``` "path/to/this.file.ext" :e:e:r:r ^ ^-------- *fnamep +------------- tail ``` This means for a ":r", we'll go before `*fnamep`, and outside the bounds of the filename. This is both incorrect and causes neovim to exit with an allocation error. We exit because we attempt to calculate `s - *fnamep` (line 23948). Since `s` is before `*fnamep`, we caluclate a negative length, which ends up being interpreted as an amount to allocate, causing neovim to exit with ENOMEM (`memory.c:xmalloc`). We must instead ensure we don't go before `*fnamep` nor `tail`. The check for `tail` is still relevant, for example: ``` "path/to/this.file.ext" :r:r:r ^ ^------------- tail +--------------------- *fnamep ``` Here we don't want to go before `tail`. close #11165
* test: use helpers.pathroot() to avoid a syscallJan Edmund Lazo2018-01-29
|
* test: fnamemodify with :8 filename modifierJan Edmund Lazo2018-01-28
|
* fixup: get network drive only, not entire pathJan Edmund Lazo2018-01-28
|
* test: win: get current network drive via io.popenJan Edmund Lazo2018-01-28
|
* test: win: add tests for shellslashJan Edmund Lazo2018-01-28
|
* test: fnamemodify()Justin M. Keyes2018-01-28