Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failing unit test #788

Closed
snoblenet opened this issue Jul 30, 2024 · 4 comments
Closed

failing unit test #788

snoblenet opened this issue Jul 30, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@snoblenet
Copy link
Contributor

Describe the bug

I've forked the repo to make a contribution.

I've made no changes so far.

When I run the unit tests, it fails on line 48 in tests/plenary/init_spec.lua.

org.files:add_to_paths_sync(fname)
assert.is.Not.Nil(org.files.files[fname])

It's because this line changes the filepath before adding it to the table.

-- /var/folders/d3/24_x70js67s5bb9g6bdy8cg00000gn/T/nvim.steven/N5iaBo/0.org 
filename = vim.fn.resolve(vim.fn.fnamemodify(filename, ':p'))
-- /private/var/folders/d3/24_x70js67s5bb9g6bdy8cg00000gn/T/nvim.steven/N5iaBo/0.org

So, trying to find the file in the table using the original filepath does not work.

Any suggestions?

Steps to reproduce

  1. git clone
  2. change nothing
  3. run make test

Expected behavior

All tests pass.

Emacs functionality

No response

Minimal init.lua

-- Enter your minimal_init.lua here

Screenshots and recordings

No response

OS / Distro

Mac OS X 14.6

Neovim version/commit

v0.10.1

Additional context

No response

@snoblenet snoblenet added the bug Something isn't working label Jul 30, 2024
@kristijanhusak
Copy link
Member

Try removing vim.fn.resolve and see if it works without it.

@snoblenet
Copy link
Contributor Author

snoblenet commented Jul 31, 2024

Yes, that works.

I believe that /private is a Mac-only directory of symlinks, and the tests assume real files, so we should probably be doing something like this:

-    local fname = vim.fn.tempname() .. '.org'
+    local fname = vim.fn.resolve(vim.fn.tempname() .. '.org')

Is everyone OK with me including that change in a PR that I hope to raise?

@snoblenet
Copy link
Contributor Author

I fixed this issue in this PR -- review appreciated

#789

@seflue
Copy link
Contributor

seflue commented Aug 18, 2024

@kristijanhusak, @snoblenet As the PR is merged, this issue can be closed, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants