3 releases

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

#206 in Testing

Download history 372/week @ 2024-05-21 28/week @ 2024-05-28 4/week @ 2024-06-04 3/week @ 2024-06-11

407 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