neovim/test/unit
zeertzjq 0cf7e2570c fix(path): avoid chdir() when resolving path (#28799)
Use uv_fs_realpath() instead.

It seems that uv_fs_realpath() has some problems on non-Linux platforms:
- macOS and other BSDs: this function will fail with UV_ELOOP if more
  than 32 symlinks are found while resolving the given path.  This limit
  is hardcoded and cannot be sidestepped.
- Windows: while this function works in the common case, there are a
  number of corner cases where it doesn't:
  - Paths in ramdisk volumes created by tools which sidestep the Volume
    Manager (such as ImDisk) cannot be resolved.
  - Inconsistent casing when using drive letters.
  - Resolved path bypasses subst'd drives.

Ref: https://docs.libuv.org/en/v1.x/fs.html#c.uv_fs_realpath

I don't know if the old implementation that uses uv_chdir() and uv_cwd()
also suffers from the same problems.
- For the ELOOP case, chdir() seems to have the same limitations.
- On Windows, Vim doesn't use anything like chdir() either. It uses
  _wfullpath(), while libuv uses GetFinalPathNameByHandleW().

(cherry picked from commit 42aa69b076)
2024-05-17 10:39:17 +00: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): avoid chdir() when resolving path (#28799) 2024-05-17 10:39:17 +00: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(lua): "module" => "M" #28426 2024-04-20 09:06:49 -07:00
undo_spec.lua refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00