Skip to content

Better regex for tests #10

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

playday3008
Copy link

Here is an example: https://regex101.com/r/ppym6S/1

@playday3008
Copy link
Author

Note, should fix #7 and #8 (couldn't reproduce)

Copy link

@mnemnion mnemnion left a comment

Choose a reason for hiding this comment

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

This regex will match a test with no name, which is legal Zig.

Have you confirmed that the patch will run the correct test if there is more than one test block with no name?

Legally, zig test not required to be at the beginning of a line
@playday3008
Copy link
Author

It will, because it's not making a list of all test in file, it just runs closest one to the cursor (actually, it looks from cursor up and if nothing found, then down)

@playday3008
Copy link
Author

Also after today's commit, it will recognize tests which are not defined at the start of the line
Here's new example: https://regex101.com/r/PsXpFH/1

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