Skip to content

Commit

Permalink
Auto merge of #14430 - Rustin170506:rustin-patch-14409, r=epage
Browse files Browse the repository at this point in the history
test: add a regression test for Issue 14409
  • Loading branch information
bors committed Aug 20, 2024
2 parents c956e9f + 90b7387 commit a87a6dc
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/testsuite/cargo_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ mod within_ws;
mod within_ws_and_pick_ws_package;
mod within_ws_with_alternative_registry;
mod within_ws_without_lockfile;
mod without_requiring_registry_auth;

// Initialize the registry without a token.
// Otherwise, it will try to list owners of the crate and fail.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[registry]
global-credential-providers = ["false"]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]

[package]
name = "cargo-list-test-fixture"
version = "0.0.0"

[dependencies]
my-package = "0.1"
Empty file.
26 changes: 26 additions & 0 deletions tests/testsuite/cargo_info/without_requiring_registry_auth/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use cargo_test_support::prelude::*;
use cargo_test_support::{compare::assert_ui, current_dir, file, Project};

use super::init_registry_without_token;

#[cargo_test]
fn case() {
init_registry_without_token();
cargo_test_support::registry::Package::new("my-package", "0.1.1+my-package").publish();

let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;

snapbox::cmd::Command::cargo_ui()
.arg("info")
.arg("my-package")
.arg("--registry=dummy-registry")
.current_dir(cwd)
.assert()
.success()
.stdout_eq(file!["stdout.term.svg"])
.stderr_eq(file!["stderr.term.svg"]);

assert_ui().subset_matches(current_dir!().join("out"), &project_root);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[registry]
global-credential-providers = ["false"]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]

[package]
name = "cargo-list-test-fixture"
version = "0.0.0"

[dependencies]
my-package = "0.1"
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a87a6dc

Please sign in to comment.