Crates.io | extel_parameterized |
lib.rs | extel_parameterized |
version | 0.1.1 |
source | src |
created_at | 2023-09-23 07:45:49.283093 |
updated_at | 2023-10-02 18:56:18.246261 |
description | A proc macro crate for creating parameterized tests for Extel |
homepage | |
repository | https://github.com/jtstrader/extel |
max_upload_size | |
id | 981115 |
size | 5,547 |
Extel Parameterized, or just parameterized, is a proc macro crate that serves to offer a
parameters
macro for converting single argument functions into a valid function that
Extel
can interpret.
use extel::prelude::*;
use extel_parameterized::parameters;
fn single_test() -> ExtelResult {
let mut my_cmd = cmd!("echo -n \"hello world\"");
let output = my_cmd.output()?;
let string_output = String::from_utf8(output.stdout)?;
extel_assert!(
string_output == *"hello world",
"expected 'hello world', got '{}'"
string_output
)
}
#[parameters(1, 2, -2, 4)]
fn param_test(x: i32) -> ExtelResult {
extel_assert!(x > 0, "{} <= 0", x)
}
fn main() {
init_test_suite!(ExtelDemo, single_test, param_test);
ExtelDemo::run(TestConfig::default());
}