expectest
Work In Progress
Library provides functions for unit testing with human-readable syntax. Inspired by Nimble for Swift.
One of main purposes of this library is to show what data was used in a broken test. Consider this example:
let result = ...;
expect!.to;
Assume that 'result' contains vec: [1, 2, 2]
. Of course test fails and gives us a message:
Note: You need to use
cargo test -- --nocapture
to see output from tests.
Usage
In Cargo.toml:
[]
= "*"
In your crate:
extern crate expectest;
You can export all needed functions and types from prelude
module:
use *;
Simple unit test:
expect!.to;
License
MIT