Crates.io | lazytest |
lib.rs | lazytest |
version | 0.1.2 |
source | src |
created_at | 2024-05-24 13:11:13.528954 |
updated_at | 2024-05-26 09:30:25.518478 |
description | Reduces the boilerplate required for simple unit tests |
homepage | |
repository | https://github.com/deref0ptr/lazytest |
max_upload_size | |
id | 1251103 |
size | 3,928 |
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);
}
}