Created
August 7, 2018 20:30
-
-
Save PhilipDaniels/348ab062d1878baff84c8f0d58efe58f to your computer and use it in GitHub Desktop.
How to use the #[test] attribute in Rust
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(test)] | |
mod tests { | |
#[test] | |
fn it_works() { | |
assert_eq!(2 + 2, 4); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment