From 69c6657127546cf1b8a02751ae328421c8f366f8 Mon Sep 17 00:00:00 2001 From: Juliana Fajardini Date: Wed, 22 Dec 2021 17:57:25 +0000 Subject: [PATCH] devguide: clarify cargo test usage for modules The documentation was showing an invalid path for running single tests. --- doc/devguide/codebase/unittests-rust.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/devguide/codebase/unittests-rust.rst b/doc/devguide/codebase/unittests-rust.rst index 4b196f25d7..c11d6e44e8 100644 --- a/doc/devguide/codebase/unittests-rust.rst +++ b/doc/devguide/codebase/unittests-rust.rst @@ -80,11 +80,12 @@ From ``nfs > rpc_records.rs``: Once that is done, Rust should recognize the new test. If you want to check a single test, run:: - cargo test module::test_name + cargo test module::file_name::tests::test_name -or even:: +Where ``tests`` refers to ``mod tests``. If you know the test name is unique, you can even run:: cargo test test_name -if you know it's a unique function name. Following the same idea, it is also possible to test specific modules or -submodules. +Following the same idea, it is also possible to test specific modules or submodules. For instance:: + + cargo test nfs::rpc_records