Skip to content

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 path test_case::test_case or import test_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

Clone this wiki locally