Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(tests): add tests for utils.fs and utils.current_file_path() #890

Merged

Conversation

troiganto
Copy link
Contributor

Summary

These are some tests I wrote while wrapping my head around how the path-handling utils work. 🙂

Related Issues

Extracted from #878

Changes

I've split things into multiple commits to make the review a bit easier.

  • changed one function in mappings.lua from formatting headline tags manually to using utils.tags_to_string()
  • changed one occurrence of vim.cmd(("edit %s"):format(file)) to vim.cmd.edit(file)
  • refactored tests/plenary/helpers.lua to declare its exported functions the same way all other modules do
  • added functions with_var() and with_cwd() to helpers.lua to temporarily change global state
  • added tests for utils.current_file_path() function
  • added tests for utils.fs module

Checklist

I confirm that I have:

  • Followed the Conventional Commits specification (e.g., feat: add new feature, fix: correct bug, docs: update documentation).
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with make test.
  • Checked for breaking changes and documented them, if any.

Copy link
Member

@kristijanhusak kristijanhusak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kristijanhusak kristijanhusak merged commit 3583fac into nvim-orgmode:master Feb 4, 2025
6 checks passed
@troiganto troiganto deleted the feat/add-current-file-path-tests branch February 4, 2025 13:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants