-
Notifications
You must be signed in to change notification settings - Fork 39
Getting Started
luke.biel edited this page Feb 13, 2022
·
2 revisions
- Add test-case to your project Cargo.toml:
test-case = "*"
- Import
test_case
to the scope you are using it in:
use test_case::test_case;
Rust introduced it's own
test_case
to the stdlib. Due to that we must either use fully qualified pathtest_case::test_case
or importtest_case
macro to the scope.
- Add test cases to your function
#[test_case(input => output_matcher ; "optional comment")]
fn testing_function(input: Type) -> ResultType {
body!()
}
Test case syntax can be found here