NTest
Testing framework for rust which enhances the built-in library with some useful features. Inspired by the .Net unit-testing framework NUnit.
Getting Started
Some functions of NTest use procedural macros which are stable for rust edition 2018. If you use the library make sure that you are using the 2018 version of rust. Update the Cargo.toml file:
[]
= "2018"
# ..
Add the NTest library to your developer dependencies in the Cargo.toml file:
[]
= "*"
Use the NTest functions you need. For example:
use test_case;
Content
#[timeout()]
Attribute used for timeouts in tests.#[test_case()]
Attribute used to define multiple test cases for a test function.assert_about_equal!()
Compare two floating point values or vectors for equality.assert_false!()
Expects false argument for test case.assert_true!()
Expects true argument for test case.assert_panics!()
Expects block to panic. Otherwise the test fails.
For more information read the documentation.
Contribution
All contributions and comments welcome! Open an issue or create a Pull Request whenever you find a bug or have an idea to improve this crate.
License
This project is licensed under the MIT License - see the LICENSE file for details.