Skip to content

Commit 9944854

Browse files
committed
Make build queue test independent of database ids
1 parent e7407bf commit 9944854

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

src/build_queue.rs

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ mod tests {
283283
let queue = env.build_queue();
284284

285285
let test_crates = [
286-
("foo", "1.0.0", -10),
287286
("bar", "1.0.0", 0),
287+
("foo", "1.0.0", -10),
288288
("baz", "1.0.0", 10),
289289
];
290290
for krate in &test_crates {
@@ -293,26 +293,15 @@ mod tests {
293293

294294
assert_eq!(
295295
vec![
296-
QueuedCrate {
297-
id: 1,
298-
name: "foo".into(),
299-
version: "1.0.0".into(),
300-
priority: -10,
301-
},
302-
QueuedCrate {
303-
id: 2,
304-
name: "bar".into(),
305-
version: "1.0.0".into(),
306-
priority: 0,
307-
},
308-
QueuedCrate {
309-
id: 3,
310-
name: "baz".into(),
311-
version: "1.0.0".into(),
312-
priority: 10,
313-
},
296+
("foo", "1.0.0", -10),
297+
("bar", "1.0.0", 0),
298+
("baz", "1.0.0", 10),
314299
],
315-
queue.queued_crates()?
300+
queue
301+
.queued_crates()?
302+
.iter()
303+
.map(|c| (c.name.as_str(), c.version.as_str(), c.priority))
304+
.collect::<Vec<_>>()
316305
);
317306

318307
Ok(())

0 commit comments

Comments
 (0)