expect-rust
This is the jest expect like matcher.
example
expect
Function to use when you want to test a value. The test always starts here.
let a = some_function;
expect.equals;
equals
Evaluate equivalency
let a = some_function;
expect.equals;
should panic
Expect the function call to terminate at Panic
let f = ;
expect.should_panic; // Ok
let f = ;
expect.should_panic; // Ng
is some and equals
Tests that one of the values can be obtained and that the expected value can be obtained.
let v = Some;
expect.is_some_equal_to;
Usage
Use the crates.io repository; add this to your Cargo.toml along with the rest of your dependencies:
[]
= "*"
or
= { = "https://github.com/ishibashi-futos/expect-rust", = "main" }
LICENSE
MIT