mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Show existing behavior
This commit is contained in:
parent
045bf21b36
commit
1948c90a78
@ -9,6 +9,7 @@ use std::path::{Path, PathBuf};
|
||||
|
||||
use cargo::core::features::{GitFeatures, GitoxideFeatures};
|
||||
use cargo::core::{PackageIdSpec, Shell};
|
||||
use cargo::util::auth::RegistryConfig;
|
||||
use cargo::util::context::{
|
||||
self, Definition, GlobalContext, JobsConfig, SslVersionConfig, StringList,
|
||||
};
|
||||
@ -2164,6 +2165,37 @@ gitoxide = \"fetch\"
|
||||
}
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn nonmergable_lists() {
|
||||
let root_path = paths::root().join(".cargo/config.toml");
|
||||
write_config_at(
|
||||
&root_path,
|
||||
"\
|
||||
[registries.example]
|
||||
credential-provider = ['a', 'b']
|
||||
",
|
||||
);
|
||||
|
||||
let foo_path = paths::root().join("foo/.cargo/config.toml");
|
||||
write_config_at(
|
||||
&foo_path,
|
||||
"\
|
||||
[registries.example]
|
||||
credential-provider = ['c', 'd']
|
||||
",
|
||||
);
|
||||
|
||||
let gctx = GlobalContextBuilder::new().cwd("foo").build();
|
||||
let provider = gctx
|
||||
.get::<Option<RegistryConfig>>(&format!("registries.example"))
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.credential_provider
|
||||
.unwrap();
|
||||
assert_eq!(provider.path.raw_value(), "a");
|
||||
assert_eq!(provider.args, ["b", "c", "d"]);
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn build_std() {
|
||||
let gctx = GlobalContextBuilder::new()
|
||||
|
Loading…
x
Reference in New Issue
Block a user