Skip to content

Commit

Permalink
Accept --test multiple times
Browse files Browse the repository at this point in the history
Fixes #437
  • Loading branch information
mitsuhiko committed Feb 19, 2024
1 parent 9f9c890 commit fd86b00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to insta and cargo-insta are documented here.
- The `--package` parameter can be supplied multiple times now. (#427)
- Leading newlines in snapshots are now ignored to resolve issues with
inline snapshots that were never able to match. (#444)
- `cargo insta test` now accepts the `--test` parameter multiple times. (#437)

## 1.34.0

Expand Down
6 changes: 3 additions & 3 deletions cargo-insta/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ struct TestCommand {
/// Test all examples
#[structopt(long)]
examples: bool,
/// Test only the specified test target
/// Test only the specified test targets
#[structopt(long)]
test: Option<String>,
test: Vec<String>,
/// Test all tests
#[structopt(long)]
tests: bool,
Expand Down Expand Up @@ -847,7 +847,7 @@ fn prepare_test_runner<'snapshot_ref>(
proc.arg("--examples");
prevents_doc_run = true;
}
if let Some(ref test) = cmd.test {
for test in &cmd.test {
proc.arg("--test");
proc.arg(test);
prevents_doc_run = true;
Expand Down

0 comments on commit fd86b00

Please sign in to comment.