-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
Consider the following two tests:
#[test]
fn it_works() { /* ... */ }
#[test]
fn it_works_complexly() { /* ... */ }
There is currently no way to run only it_works
, and not it_works_complexly
:
$ cargo t it_works
running 2 tests
test it_works ... ok
test it_works_more ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
In Go, the filter is a regular expression, so one can use go test 'it_works$'
, but this not work in Rust (because the test harness presumably just uses simple substring matching):
$ cargo t 'it_works$'
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.