Crates.io | egress |
lib.rs | egress |
version | 0.1.1 |
source | src |
created_at | 2020-02-13 02:16:44.531325 |
updated_at | 2020-02-13 05:49:24.873168 |
description | A super simple, bare-bones regression testing crate. |
homepage | https://github.com/sdleffler/egress |
repository | https://github.com/sdleffler/egress |
max_upload_size | |
id | 207889 |
size | 23,312 |
Egress is a super simple regression testing framework for Rust. It doesn't currently support much, but if all you want is to make sure some test outputs don't change from run to run, it'll do the trick.
By default, Egress will make an Egress.toml
config file in the same
directory as your Cargo.toml
and an egress
folder in the same place
to hold the artifacts it writes to disk.
let mut egress = egress!();
let artifact = egress.artifact("basic_arithmetic");
let super_complex_test_output_that_could_change_at_any_time = 1 + 1;
// using `serde::Serialize`:
artifact.insert_serialize("1 + 1 (serde)", &super_complex_test_output_that_could_change_at_any_time);
// or using `fmt::Debug`:
artifact.insert_debug("1 + 1 (fmt::Debug)", &super_complex_test_output_that_could_change_at_any_time);
// or using `fmt::Display`:
artifact.insert_display("1 + 1 (fmt::Display)", &super_complex_test_output_that_could_change_at_any_time);
// More options available; please check the docs.
egress.close().unwrap().assert_unregressed();
To see the artifacts produced by this example, check egress/artifacts/rust_out/basic_arithmetic.json
.