Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 999 Bytes

tests.md

File metadata and controls

41 lines (28 loc) · 999 Bytes

Testing on the Command Line

Execute the tests with:

$ cargo test

All but the first test have been ignored. After you get the first test to pass, open the tests source file which is located in the tests directory and remove the #[ignore] flag from the next test and get the tests to pass again. Each separate test is a function with #[test] flag above it. Continue, until you pass every test.

If you wish to run only ignored tests without editing the tests source file, use:

$ cargo test -- --ignored

If you are using Rust 1.51 or later, you can run all tests with

$ cargo test -- --include-ignored

To run a specific test, for example some_test, you can use:

$ cargo test some_test

If the specific test is ignored, use:

$ cargo test some_test -- --ignored

To learn more about Rust tests refer to the online test documentation.