fix(tests): Switch from --nocapture to --no-capture (#30638)

`--no-capture` was added in 1.88, with `--nocapture` being
soft-deprecated.
https://releases.rs/docs/1.88.0/#libraries
This commit is contained in:
Kingsword 2025-09-08 16:40:56 +08:00 committed by GitHub
parent 54bda9febc
commit d471a80f7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -26,11 +26,11 @@ Or just the following, though it might run other tests:
cargo test test_name
```
To run showing the output of every test use `-- --nocapture` (note: this will
To run showing the output of every test use `-- --no-capture` (note: this will
cause tests to run sequentially instead of in parallel):
```
cargo test test_name -- --nocapture
cargo test test_name -- --no-capture
```
## `__test__.json` file

View file

@ -25,8 +25,9 @@ use test_util::tests_path;
const MANIFEST_FILE_NAME: &str = "__test__.jsonc";
static NO_CAPTURE: Lazy<bool> =
Lazy::new(|| std::env::args().any(|arg| arg == "--nocapture"));
static NO_CAPTURE: Lazy<bool> = Lazy::new(|| {
std::env::args().any(|arg| arg == "--no-capture" || arg == "--nocapture")
});
#[derive(Clone, Deserialize)]
#[serde(untagged)]