#test-framework #macro

archived macro stf-macro

An example of a simple test framework in Rust

1 unstable release

0.1.0 Oct 7, 2022

#34 in #test-framework

GPL-3.0 license

3KB

simple-test-framework

An example of a simple test framework in Rust

Usage

#![feature(custom_test_frameworks)]
#![test_runner(stf_runner::test_runner)]

use stf_macro::simple_test;

pub fn add(left: usize, right: usize) -> usize {
    left + right
}

#[simple_test]
fn it_works() {
    let result = add(2, 2);
    assert_eq!(result, 4);
}

Dependencies

~1.5MB
~32K SLoC