Skip to content

Commit 90b7387

Browse files
committed
test: add a regression test for Issue 14409
Signed-off-by: hi-rustin <[email protected]>
1 parent c956e9f commit 90b7387

File tree

12 files changed

+152
-0
lines changed

12 files changed

+152
-0
lines changed

tests/testsuite/cargo_info/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ mod within_ws;
2828
mod within_ws_and_pick_ws_package;
2929
mod within_ws_with_alternative_registry;
3030
mod within_ws_without_lockfile;
31+
mod without_requiring_registry_auth;
3132

3233
// Initialize the registry without a token.
3334
// Otherwise, it will try to list owners of the crate and fail.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[registry]
2+
global-credential-providers = ["false"]

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

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[workspace]
2+
3+
[package]
4+
name = "cargo-list-test-fixture"
5+
version = "0.0.0"
6+
7+
[dependencies]
8+
my-package = "0.1"

tests/testsuite/cargo_info/without_requiring_registry_auth/in/src/lib.rs

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use cargo_test_support::prelude::*;
2+
use cargo_test_support::{compare::assert_ui, current_dir, file, Project};
3+
4+
use super::init_registry_without_token;
5+
6+
#[cargo_test]
7+
fn case() {
8+
init_registry_without_token();
9+
cargo_test_support::registry::Package::new("my-package", "0.1.1+my-package").publish();
10+
11+
let project = Project::from_template(current_dir!().join("in"));
12+
let project_root = project.root();
13+
let cwd = &project_root;
14+
15+
snapbox::cmd::Command::cargo_ui()
16+
.arg("info")
17+
.arg("my-package")
18+
.arg("--registry=dummy-registry")
19+
.current_dir(cwd)
20+
.assert()
21+
.success()
22+
.stdout_eq(file!["stdout.term.svg"])
23+
.stderr_eq(file!["stderr.term.svg"]);
24+
25+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
26+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[registry]
2+
global-credential-providers = ["false"]

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

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[workspace]
2+
3+
[package]
4+
name = "cargo-list-test-fixture"
5+
version = "0.0.0"
6+
7+
[dependencies]
8+
my-package = "0.1"

tests/testsuite/cargo_info/without_requiring_registry_auth/out/src/lib.rs

Whitespace-only changes.
Lines changed: 31 additions & 0 deletions
Loading
Lines changed: 42 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)