extel_parameterized 0.1.1

A proc macro crate for creating parameterized tests for Extel
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 5.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 252.21 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • jtstrader/xtl
    1 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jtstrader

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());
}