From c6ae10c4a859ca55eb32488832bdfbdfeec6bfa4 Mon Sep 17 00:00:00 2001 From: Peteris Ledins Date: Wed, 19 Jul 2023 22:56:39 +0300 Subject: [PATCH] Refer to `--exact` for running exact one test --- src/ch11-02-running-tests.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ch11-02-running-tests.md b/src/ch11-02-running-tests.md index 194718256c..14d00eb042 100644 --- a/src/ch11-02-running-tests.md +++ b/src/ch11-02-running-tests.md @@ -130,6 +130,10 @@ Only the test with the name `one_hundred` ran; the other two tests didn’t matc that name. The test output lets us know we had more tests that didn’t run by displaying `2 filtered out` at the end. +If a test name is a substring of another test, we can use `-- --exact` argument, +referring to test function with full path, for example +`cargo test tests::one_hundred -- --exact`. + We can’t specify the names of multiple tests in this way; only the first value given to `cargo test` will be used. But there is a way to run multiple tests.