Skip to content

fix: make TestNearest search both directions for zig - #903

Merged
codeinabox merged 1 commit into
vim-test:masterfrom
mark2185:master
May 6, 2026
Merged

fix: make TestNearest search both directions for zig#903
codeinabox merged 1 commit into
vim-test:masterfrom
mark2185:master

Conversation

@mark2185

@mark2185 mark2185 commented May 6, 2026

Copy link
Copy Markdown
Contributor

Make sure these boxes are checked before submitting your pull request:

  • Add fixtures and spec when implementing or updating a test runner
  • Update the README accordingly
  • Update the Vim documentation in doc/test.txt

I'm not sure if this is on anyone's wishlist, but I found it odd that TestNearest behaved like TestFile when there were no tests above the current line. This PR makes it run the nearest test below in case it finds no tests upwards, which is what I'd expect from the Nearest in the name, and if somebody actually wanted to run all of the tests then there's TestFile.

This is now probably an inconsistency compared to other test runners, but I haven't used any of them so...

In any case, I'd rather have this closed (but not deleted) in case somebody has the same itch than not having it published anywhere at all.

@codeinabox

Copy link
Copy Markdown
Collaborator

Thank you for this! Could you please update the spec for this? It should just be a case of adding another example for TestNearest

@mark2185

mark2185 commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Sure thing!

As soon as I fix a small bug that I've stumbled upon (wrong line number when searching downwards because of the line indices).

EDIT: on second thought, that's a separate issue that does not clash with this change, it'll be addressed in a follow-up PR.

@codeinabox
codeinabox merged commit e312c0e into vim-test:master May 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants