test-macro
Overview
This is a macro for writing Rust test code in an easy way.
Getting Started
Crate has to be added as a dev-dependency to Cargo.toml.
[]
= "0.1.9"
Example Usage
Consider testing the add function shown below.
In this case, if you want to write the test code in the tests directory, you can write it as follows.
// Need to import add function.
test_assert_eq!;
If you want to write it outside the tests directory, you can write it as follows.
This difference comes from importing the test-macro crate as a dev-dependencies crate.