Skip to content

Instantly share code, notes, and snippets.

@PhilipDaniels
Created August 7, 2018 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilipDaniels/348ab062d1878baff84c8f0d58efe58f to your computer and use it in GitHub Desktop.
Save PhilipDaniels/348ab062d1878baff84c8f0d58efe58f to your computer and use it in GitHub Desktop.
How to use the #[test] attribute in Rust
#[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