testgen
This library is still very early in development!
Generate simple tests with testgen
!
```rust extern crate testgen; use testgen::{fail, multifail, multipass, pass};
fn add_one(n: i32) -> i32 { n + 1 }
// Multiple arguments are passed in like a tuple.
// Though to use an actual tuple use ((a, b))
.
// Single-argument functions can have the parenthesis elided in most cases.
fn add(n: i32, m: i32) -> i32 { n + m }
fn main() {} ```
Output:
``` Compiling testgen v0.0.1 (/mnt/F/Development/Rust/testgen) Finished dev [unoptimized + debuginfo] target(s) in 1.05s Running target/debug/examples/doc_example-79f4317fab9ffdf5
running 4 tests test addmultitestpass ... ok test optional ... ok test addonemultitestfail ... ok test addtest_fail ... ok
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ```
testgen
is licensed under both MIT and Apache 2.0