bug: tests fail on MacOS #102
Labels
No labels
autorelease: pending
autorelease: tagged
bug
ci/cd
documentation
duplicate
enhancement
good first issue
help wanted
improvement
invalid
priority
high
priority
low
question
refactor
size
L
size
M
size
S
size
XS
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/haunt.nvim#102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Did you check docs and existing issues?
Neovim version (nvim -v)
nightly
Operating system/version
MacOS
Describe the bug
@TheNoeTrevino i finally found why the tests fail locally for me. I am guessing you are not on macOS. macOS has var symlinked to /private/var.
function M.create_test_buffer(lines, filename)
local bufnr = vim.api.nvim_create_buf(false, false)
local test_file = filename or (vim.fn.tempname() .. ".lua")
vim.api.nvim_buf_set_name(bufnr, test_file)
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines or { "Line 1", "Line 2", "Line 3" })
vim.api.nvim_set_current_buf(bufnr)
return bufnr, test_file
end
So the vim.fntempname()returns/var/folders/...but Neovim resolves the buffer name to/private/var/folders/...`. The test keep the original path tho.
Either running this passes all tests for me:
TMPDIR=/private/tmp ./scripts/test
Or resolving the path before assigning the buffer name also fixed it:
Can you confirm this still works for you ? 🤔
Steps To Reproduce
run tests on mac
Expected Behavior
should pass
Repro
If you see this an you own a mac, this is a great first issue. I dont have one, so I am not able to test this.
Description shows another contributor having trouble running tests due to mac having var symlinked to something else. Something like that.