neovim/test/unit
Joey Gouly f064e72b9b
fix(path): check return value of append_path() (#28309)
If the filename passed to vim_FullName() is a relative directory, and
does not exist, it is appended to the current working directory. Since
the return value of append_path() was ignored, and if the buffer length
was too small to fit getcwd() + dirname(filename), it would still try to
append the basename(filename).

This was manifesting as a failure in test/unit/path_spec.lua in:
    itp('fails and uses filename if given filename contains non-existing directory', ..

This failure occurs when running the tests from directory with a short
path such as: /work/src/nv

    test/unit/path_spec.lua:420: Expected objects to be the same.
    Passed in:
    (string) '/work/src/nv/test.file'
    Expected:
    (string) 'non_existing_dir/test.file'

This return value for the second call to append_path() to append
basename(filename) was checked, and this is where it would fail for
normal / longer getcwd()s.
2024-04-13 11:25:55 +08:00
..
api refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
charset refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
eval refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
fixtures refactor: change event_create() to a macro (#26343) 2023-12-01 15:22:22 +08:00
os refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
viml refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
buffer_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
fileio_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
formatc.lua docs: small fixes (#26243) 2023-12-06 08:04:21 +08:00
garray_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
indent_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
keycodes_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
marktree_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
mbyte_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
memory_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
message_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
msgpack_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
multiqueue_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
optionstr_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
path_spec.lua fix(path): check return value of append_path() (#28309) 2024-04-13 11:25:55 +08:00
preload.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
preprocess.lua test: improve test conventions 2024-04-08 22:51:00 +02:00
profile_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
rbuffer_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
search_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
set.lua build: enable lintlua for test/unit/ dir #26396 2023-12-04 14:32:39 -08:00
statusline_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
strings_spec.lua fix(test): fix strings_spec.lua for AArch64 2024-04-12 17:37:57 +01:00
tempfile_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
testtest_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
testutil.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
undo_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00