Skip to content

Commit 3582f4f

Browse files
committed
test(info): add add the with default registry configured and specified case
1 parent 97cb792 commit 3582f4f

File tree

16 files changed

+161
-0
lines changed

16 files changed

+161
-0
lines changed

tests/testsuite/cargo_info/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ mod specify_version_within_ws_and_match_with_lockfile;
1818
mod transitive_dependency_within_ws;
1919
mod verbose;
2020
mod with_default_registry_configured;
21+
mod with_default_registry_configured_and_specified;
2122
mod with_frozen_outside_ws;
2223
mod with_frozen_within_ws;
2324
mod with_locked_outside_ws;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[registry]
2+
default = "crates-io"

tests/testsuite/cargo_info/with_default_registry_configured_and_specified/in/Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[workspace]
2+
members = ["crates/*"]
3+
4+
[package]
5+
name = "foo"
6+
version = "0.0.0"
7+
8+
[dependencies]
9+
crate1 = { path = "./crates/crate1" }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "crate1"
3+
version = "0.0.0"
4+
5+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
use crate::prelude::*;
2+
use cargo_test_support::{Project, compare::assert_ui, current_dir, file};
3+
4+
use super::init_registry_without_token;
5+
6+
#[cargo_test]
7+
fn case() {
8+
init_registry_without_token();
9+
10+
for ver in ["0.1.1+foo", "0.2.0+foo"] {
11+
cargo_test_support::registry::Package::new("foo", ver).publish();
12+
}
13+
14+
let project = Project::from_template(current_dir!().join("in"));
15+
let project_root = project.root();
16+
let cwd = &project_root;
17+
18+
snapbox::cmd::Command::cargo_ui()
19+
.arg("info")
20+
.arg_line("--verbose foo")
21+
.arg("--registry=dummy-registry")
22+
.current_dir(cwd)
23+
.assert()
24+
.success()
25+
.stdout_eq(file!["stdout.term.svg"])
26+
.stderr_eq(file!["stderr.term.svg"]);
27+
28+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
29+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[registry]
2+
default = "crates-io"

tests/testsuite/cargo_info/with_default_registry_configured_and_specified/out/Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)