extel_parameterized

Crates.ioextel_parameterized
lib.rsextel_parameterized
version0.1.1
sourcesrc
created_at2023-09-23 07:45:49.283093
updated_at2023-10-02 18:56:18.246261
descriptionA proc macro crate for creating parameterized tests for Extel
homepage
repositoryhttps://github.com/jtstrader/extel
max_upload_size
id981115
size5,547
Jacob Strader (jtstrader)

documentation

README

Extel Parameterized - Writing Parameterized Tests in Rust

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());
}
Commit count: 53

cargo fmt