lazytest
Provides a macro which reduces the boilerplate required for simple unit tests.
Usage
Given the function:
These are equivalent:
use lazytest;
lazytest!
Provides a macro which reduces the boilerplate required for simple unit tests.
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);
}
}