Created
November 6, 2019 17:05
-
-
Save rust-play/63b7c03e38c047ceb0aab053d9fd2485 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or 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
// You can run a single test by passing the name of that test to `cargo test` | |
#[test] | |
fn does_stuff() { | |
let t: bool = true; | |
t | |
} | |
// To run this test from the command line: | |
// cargo test does_stuff | |
// You can run multiple tests by passing a substring of the tests names | |
#[test] | |
fn does_some_stuff() { | |
let t: bool = true; | |
t | |
} | |
#[test] | |
fn does_other_stuff() { | |
let t: bool = true; | |
t | |
} | |
// To run both of these tests from the command line: | |
// cargo test does_ | |
// To use `println` and not have it destroyed by the Rust test harness use `-- --nocapture` | |
#[test] | |
fn wow_test() { | |
let t: bool = true; | |
println!("{:#?}", t); | |
t | |
} | |
// cargo test wow_test -- --nocapture | |
// true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment