diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-08-23 18:37:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 12:37:02 +0200 |
commit | f3b2f23a1d95769082c97fc966d6eeddaea9668a (patch) | |
tree | b83e8989fb18f8d774e97727902d606263cafdfc /cli/tools/test_runner.rs | |
parent | 198699fabae37fb3f1edd6aa058ea050cc43bb19 (diff) |
refactor(cli/flags): use an optional non zero usize for `fail-fast` (#11804)
Changes the type of the `fail_fast` flag from `Option<usize>` to
`Option<NonZeroUsize>` as an optional value of zero isn't sound.
Diffstat (limited to 'cli/tools/test_runner.rs')
-rw-r--r-- | cli/tools/test_runner.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/tools/test_runner.rs b/cli/tools/test_runner.rs index d2612e59d..a4bc99822 100644 --- a/cli/tools/test_runner.rs +++ b/cli/tools/test_runner.rs @@ -469,7 +469,7 @@ pub async fn run_tests( doc_modules: Vec<ModuleSpecifier>, test_modules: Vec<ModuleSpecifier>, no_run: bool, - fail_fast: Option<usize>, + fail_fast: Option<NonZeroUsize>, quiet: bool, allow_none: bool, filter: Option<String>, @@ -621,7 +621,7 @@ pub async fn run_tests( } if let Some(x) = fail_fast { - if summary.failed >= x { + if summary.failed >= x.get() { break; } } |