Skip to content

Commit

Permalink
Make build queue test independent of database ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 authored and Joshua Nelson committed Aug 1, 2020
1 parent 44f98be commit 21e44ef
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions src/build_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ mod tests {
let queue = env.build_queue();

let test_crates = [
("foo", "1.0.0", -10),
("bar", "1.0.0", 0),
("foo", "1.0.0", -10),
("baz", "1.0.0", 10),
];
for krate in &test_crates {
Expand All @@ -293,26 +293,15 @@ mod tests {

assert_eq!(
vec![
QueuedCrate {
id: 1,
name: "foo".into(),
version: "1.0.0".into(),
priority: -10,
},
QueuedCrate {
id: 2,
name: "bar".into(),
version: "1.0.0".into(),
priority: 0,
},
QueuedCrate {
id: 3,
name: "baz".into(),
version: "1.0.0".into(),
priority: 10,
},
("foo", "1.0.0", -10),
("bar", "1.0.0", 0),
("baz", "1.0.0", 10),
],
queue.queued_crates()?
queue
.queued_crates()?
.iter()
.map(|c| (c.name.as_str(), c.version.as_str(), c.priority))
.collect::<Vec<_>>()
);

Ok(())
Expand Down

0 comments on commit 21e44ef

Please sign in to comment.