mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-07 20:50:03 +00:00
Test appending behavior of append_to_path
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
96d90c0376
commit
73af5b2824
1 changed files with 17 additions and 1 deletions
|
@ -267,7 +267,7 @@ mod test {
|
|||
version_req: "*".into(),
|
||||
current_version: Version::new(0, 2, 0),
|
||||
source: Source::cratesio_registry(),
|
||||
target,
|
||||
target: target.clone(),
|
||||
bins: vec!["1".into()],
|
||||
},
|
||||
];
|
||||
|
@ -289,5 +289,21 @@ mod test {
|
|||
metadata_set.remove("b");
|
||||
let records = Records::load_from_path(&path).unwrap();
|
||||
assert_records_eq!(&records, &metadata_set);
|
||||
// Drop the exclusive file lock
|
||||
drop(records);
|
||||
|
||||
let new_metadata = MetaData {
|
||||
name: "b".into(),
|
||||
version_req: "0.1.0".into(),
|
||||
current_version: Version::new(0, 1, 1),
|
||||
source: Source::cratesio_registry(),
|
||||
target,
|
||||
bins: vec!["1".into(), "2".into()],
|
||||
};
|
||||
append_to_path(&path, [new_metadata.clone()]).unwrap();
|
||||
metadata_set.insert(new_metadata);
|
||||
|
||||
let records = Records::load_from_path(&path).unwrap();
|
||||
assert_records_eq!(&records, &metadata_set);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue