3 releases

0.1.2 May 26, 2024
0.1.1 May 25, 2024
0.1.0 May 24, 2024

#386 in Testing

Download history 1/week @ 2024-07-26 18/week @ 2024-09-20 4/week @ 2024-09-27

97 downloads per month

MIT-0 license

4KB

lazytest

Provides a macro which reduces the boilerplate required for simple unit tests.

Usage

Given the function:

pub fn answer() -> usize {
    42
}

These are equivalent:

use lazytest::lazytest;

lazytest! {
    check_answer {
        assert_eq!(answer(), 42);
    }
}
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn check_answer() {
        assert_eq!(answer(), 42);
    }
}

lib.rs:

Provides the [lazytest] macro to reduce the amount of code needed to write unit tests.

No runtime deps