Skip to content

Commit

Permalink
test: Fix indeterministic test
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanty committed Jun 19, 2024
1 parent 964df4c commit b20e900
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/change_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ fn load_changeset() {
.unwrap();

let changeset = ChangeSet::from_directory(&dir).unwrap();
let mut releases: Vec<Release> = changeset.into();
let second_release = releases.pop().unwrap();
let first_release = releases.pop().unwrap();
let releases: Vec<Release> = changeset.into();
let first_release = releases
.iter()
.find(|release| release.package_name == first_package)
.unwrap();
assert_eq!(first_release.package_name, first_package);
assert_eq!(first_release.change_type().unwrap(), &first_change_type);
assert_eq!(
Expand All @@ -44,6 +46,10 @@ fn load_changeset() {
summary: first_change_summary.into()
},]
);
let second_release = releases
.iter()
.find(|release| release.package_name == second_package)
.unwrap();
assert_eq!(second_release.package_name, second_package);
assert_eq!(second_release.change_type().unwrap(), &second_change_type);
// Order of reading files is probably not guaranteed
Expand Down

0 comments on commit b20e900

Please sign in to comment.