lazytest 0.1.2

Reduces the boilerplate required for simple unit tests
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 3.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.05 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • deref0ptr/lazytest
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • deref0ptr

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