qutonium

github crates.io docs.rs Crates.io


simplify unit testing with a minimal testing framework 📈

DISCLAIMER

qutonium is takes is inspiration from the rust-testing-microframework. the goal is to provide a minimal testing framework for assertions (see the list of features here). the project is still in work in progress so.. DO NOT USE IN PRODUCTION. DO NOT USE IN PRODUCTION. DO NOT USE IN PRODUCTION. feedbacks appreciated!

Examples

more examples here

basic syntax

```rust fn main () {}

[cfg(test)]

mod tests { extern crate qutonium; use qutonium::prelude::*;

#[test] fn fromtest () { suite!("the suite case name ~basic", { "compare integer" || { expect!(2 + 2).to(beequal(4)); } }); } } ```

sugar syntax

```rust fn main () {}

[cfg(test)]

mod tests { extern crate qutonium; use qutonium::prelude::*;

#[test] fn from_test () { suite!("the suite case name ~sugar", { "compare integer" || { must!(2 + 2; be 4); } }); } } ```

Overview

stdout

The output format follow the syntax from crystal | ruby. s/o Siegfried Ehret

``` SUITE the suite case name TEST compare integer (0ms) ERROR 👎 received: <0> expected: <1> 📍 src/main.rs:7:7 END END TEST compare boolean (0ms) SUCCESS 👍 ok 📍 src/main.rs:12:7 END END TEST testing should panic (0ms) SUCCESS 👍 ok 📍 src/main.rs:16:7 END END END

DIAGNOSTIC 👎 failed: 1 👍 passed: 2 📈 total: 3 END ```

Usage

Add the following to your Cargo.toml:

toml [dependencies] qutonium = "0.1.3"

Goals

API

Exports

json

| handler | snippet | |---------|---------------------------------------------------------------------| | to_json | see more informations about the export here |

Markers

| marker | snippet | |---------|----------------------------| | to | expect!(expr).to(matcher) | | not | expect!(expr).not(matcher) |

Matchers

boolean

| matcher | snippet | |-----------|---------------------------------| | befalse | expect!(expr).to(be_false()) | | betrue | expect!(expr).to(be_true()) |

common

| matcher | snippet | |-------------|--------------------------------------| | be_equal | expect!(expr).to(be_equal(expr)) |

License

Copyright ÂŠī¸ 2020 Qurity

Released under the MIT license