Skip to content

Commit

Permalink
More testing and mutants::skip for LightUpdateQueue::len().
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Jan 16, 2024
1 parent d07676e commit a4da419
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions all-is-cubes/src/space/light/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ impl LightUpdateQueue {

/// Returns the number of elements that will be produced by [`Self::pop()`].
#[inline]
#[mutants::skip] // can cause infinite loops
pub fn len(&self) -> usize {
let sweep_items = match &self.sweep {
Some(sweep) => {
Expand Down Expand Up @@ -315,6 +316,7 @@ mod tests {
queue.insert(r([0, 0, 2], 200));
queue.insert(r([0, 0, 1], 100));

assert_eq!(queue.len(), 8);
assert_eq!(
drain(&mut queue),
vec![
Expand All @@ -329,6 +331,7 @@ mod tests {
r([3, 0, 0], 1),
]
);
assert_eq!(queue.len(), 0);
}

#[test]
Expand Down

0 comments on commit a4da419

Please sign in to comment.