Crates.io | data-test |
lib.rs | data-test |
version | 0.1.2 |
source | src |
created_at | 2020-05-28 03:28:28.288182 |
updated_at | 2024-04-17 01:40:37.680824 |
description | Simple data-test (aka table-test), without custom test to run with your test runner |
homepage | |
repository | https://github.com/jhg/data-test-rs |
max_upload_size | |
id | 246911 |
size | 6,791 |
Rust data-test (aka table-test) helpers
Add to your test dependencies:
[dev-dependencies]
data-test = "^0.1"
Example of usage:
#[cfg(test)]
mod tests {
use data_test::data_test;
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
data_test! {
fn is_equal(input, expected) => {
assert_eq!(input, expected);
}
- a (1, 1)
- b (2, 2)
- c (3, 3)
- d (4, 4)
- e (5, 5)
- f ("hello world", "hello world")
}
}
// cargo test output:
// test tests::it_works ... ok
// test tests::is_equal::a ... ok
// test tests::is_equal::b ... ok
// test tests::is_equal::c ... ok
// test tests::is_equal::d ... ok
// test tests::is_equal::e ... ok
// test tests::is_equal::f ... ok