Skip to content

Commit ee339e2

Browse files
authored
Update test metadata for crate_universe (#2599)
This change also updates tests to account for the change in registry reprs in Cargo.lock files. E.g. ``` tracing 0.2.0 (git+https://github.com/tokio-rs/tracing.git?branch=master#1e09e50e8d15580b5929adbade9c782a6833e4a0 ``` to ``` git+https://github.com/tokio-rs/tracing.git?branch=master#[email protected] ```
1 parent 0cb20f5 commit ee339e2

File tree

26 files changed

+5818
-5516
lines changed

26 files changed

+5818
-5516
lines changed

crate_universe/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ mod test {
282282
.collect::<Vec<_>>(),
283283
[
284284
(&CrateId::new("log".to_owned(), Version::new(0, 3, 9)), false),
285-
(&CrateId::new("log".to_owned(), Version::new(0, 4, 14)), false),
285+
(&CrateId::new("log".to_owned(), Version::new(0, 4, 21)), false),
286286
(&CrateId::new("names".to_owned(), Version::parse("0.12.1-dev").unwrap()), false),
287287
(&CrateId::new("names".to_owned(), Version::new(0, 13, 0)), false),
288288
(&CrateId::new("value-bag".to_owned(), Version::parse("1.0.0-alpha.7").unwrap()), false),

crate_universe/src/context/crate_context.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ mod test {
802802
let annotations = common_annotations();
803803

804804
let crate_annotation = &annotations.metadata.crates[&PackageId {
805-
repr: "common 0.1.0 (path+file://{TEMP_DIR}/common)".to_owned(),
805+
repr: "path+file://{TEMP_DIR}/common#0.1.0".to_owned(),
806806
}];
807807

808808
let include_binaries = false;
@@ -833,7 +833,7 @@ mod test {
833833
let annotations = common_annotations();
834834

835835
let package_id = PackageId {
836-
repr: "common 0.1.0 (path+file://{TEMP_DIR}/common)".to_owned(),
836+
repr: "path+file://{TEMP_DIR}/common#0.1.0".to_owned(),
837837
};
838838

839839
let crate_annotation = &annotations.metadata.crates[&package_id];
@@ -908,7 +908,7 @@ mod test {
908908
let annotations = build_script_annotations();
909909

910910
let package_id = PackageId {
911-
repr: "openssl-sys 0.9.87 (registry+https://github.com/rust-lang/crates.io-index)"
911+
repr: "registry+https://github.com/rust-lang/crates.io-index#[email protected]"
912912
.to_owned(),
913913
};
914914

@@ -953,7 +953,7 @@ mod test {
953953
let annotations = build_script_annotations();
954954

955955
let package_id = PackageId {
956-
repr: "openssl-sys 0.9.87 (registry+https://github.com/rust-lang/crates.io-index)"
956+
repr: "registry+https://github.com/rust-lang/crates.io-index#[email protected]"
957957
.to_owned(),
958958
};
959959

@@ -988,8 +988,7 @@ mod test {
988988
let annotations = crate_type_annotations();
989989

990990
let package_id = PackageId {
991-
repr: "sysinfo 0.22.5 (registry+https://github.com/rust-lang/crates.io-index)"
992-
.to_owned(),
991+
repr: "registry+https://github.com/rust-lang/crates.io-index#[email protected]".to_owned(),
993992
};
994993

995994
let crate_annotation = &annotations.metadata.crates[&package_id];
@@ -1024,7 +1023,7 @@ mod test {
10241023
) {
10251024
let mut annotations = common_annotations();
10261025
let crate_annotation = &annotations.metadata.crates[&PackageId {
1027-
repr: "common 0.1.0 (path+file://{TEMP_DIR}/common)".to_owned(),
1026+
repr: "path+file://{TEMP_DIR}/common#0.1.0".to_owned(),
10281027
}];
10291028
let include_binaries = false;
10301029
let include_build_scripts = false;

crate_universe/src/metadata/dependency.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,10 @@ mod test {
500500

501501
assert_eq!(
502502
BTreeSet::from([
503-
"cc 1.0.72 (registry+https://github.com/rust-lang/crates.io-index)".to_owned(),
504-
"pkg-config 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)"
503+
"registry+https://github.com/rust-lang/crates.io-index#[email protected]".to_owned(),
504+
"registry+https://github.com/rust-lang/crates.io-index#[email protected]"
505505
.to_owned(),
506-
"vcpkg 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)".to_owned()
506+
"registry+https://github.com/rust-lang/crates.io-index#[email protected]".to_owned()
507507
]),
508508
build_deps,
509509
);
@@ -518,9 +518,9 @@ mod test {
518518

519519
assert_eq!(
520520
BTreeSet::from([
521-
"libc 0.2.112 (registry+https://github.com/rust-lang/crates.io-index)".to_owned(),
522-
"libz-sys 1.1.8 (registry+https://github.com/rust-lang/crates.io-index)".to_owned(),
523-
"openssl-sys 0.9.87 (registry+https://github.com/rust-lang/crates.io-index)"
521+
"registry+https://github.com/rust-lang/crates.io-index#[email protected]".to_owned(),
522+
"registry+https://github.com/rust-lang/crates.io-index#[email protected]".to_owned(),
523+
"registry+https://github.com/rust-lang/crates.io-index#[email protected]"
524524
.to_owned(),
525525
]),
526526
normal_deps,

crate_universe/src/metadata/metadata_annotation.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ mod test {
533533
.crates;
534534
let tracing_core = crates
535535
.iter()
536-
.find(|(k, _)| k.repr.starts_with("tracing-core "))
536+
.find(|(k, _)| k.repr.contains("#tracing-core@"))
537537
.map(|(_, v)| v)
538538
.unwrap();
539539
match tracing_core {
@@ -556,7 +556,9 @@ mod test {
556556
.unwrap()
557557
.crates;
558558

559-
let package_id = PackageId { repr: "tracing 0.2.0 (git+https://github.com/tokio-rs/tracing.git?branch=master#1e09e50e8d15580b5929adbade9c782a6833e4a0)".into() };
559+
let package_id = PackageId {
560+
repr: "git+https://github.com/tokio-rs/tracing.git?branch=master#[email protected]".into(),
561+
};
560562
let annotation = crates.get(&package_id).unwrap();
561563

562564
let commitish = match annotation {

crate_universe/test_data/metadata/aliases/Cargo.lock

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

crate_universe/test_data/metadata/aliases/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ path = "lib.rs"
1414

1515
[dependencies]
1616
# Defines library targets
17-
log = "=0.4.14"
17+
log = "=0.4.21"
1818
pinned_log = { package = "log", version = "=0.3.9" }
1919

2020
# Contains a transitive alias

0 commit comments

Comments
 (0)