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

Tests with #[should_panic] macro are ignored #29

Closed
morgsmccauley opened this issue Mar 20, 2023 · 1 comment · Fixed by #30
Closed

Tests with #[should_panic] macro are ignored #29

morgsmccauley opened this issue Mar 20, 2023 · 1 comment · Fixed by #30
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@morgsmccauley
Copy link
Contributor

Adding the #[should_panic] macro, below the #[test] macro, to an existing test causes it to be ignored. Replacing the order, i.e. #[should_panic] followed by #[test] on the next line, seems to work.

This seems to be related to the treesitter query which looks for the #[test] macro on a function. Perhaps it just picks up the first macro defined?

@rouge8 rouge8 added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 21, 2023
@rouge8
Copy link
Owner

rouge8 commented Mar 21, 2023

It sounds like you have a workaround, but I'd accept a PR making the query accept #[test] followed by #[should_panic].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants