lazytest

Crates.iolazytest
lib.rslazytest
version0.1.2
sourcesrc
created_at2024-05-24 13:11:13.528954
updated_at2024-05-26 09:30:25.518478
descriptionReduces the boilerplate required for simple unit tests
homepage
repositoryhttps://github.com/deref0ptr/lazytest
max_upload_size
id1251103
size3,928
(deref0ptr)

documentation

README

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

cargo fmt