Skip to content

#[test] function name with r#keyword be auto filtered out by test framework. #99361

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

Closed
Wyvern opened this issue Jul 17, 2022 · 1 comment · Fixed by rust-lang/rust-analyzer#12993

Comments

@Wyvern
Copy link

Wyvern commented Jul 17, 2022

If put Rust keyword in a #[test] function name like r#for r#while r#break etc, e.g.

  #[test]
  fn r#mod(){
        //...
    }

then run test, the test case will be auto filtered out without warning/error.
output:

running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s

is it by design, or an unintentional bug?

env: VScode+RA on nightly channel Rust

@CryZe
Copy link
Contributor

CryZe commented Jul 17, 2022

This seems to be a rust-analyzer bug. cargo test works just fine for me.

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 a pull request may close this issue.

2 participants