Skip to content

Commit 91c902c

Browse files
authored
Add tests for iter module (#188)
This should get module-level coverage to 100%
1 parent 3321f04 commit 91c902c

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/iter.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,28 @@ where
105105
self.iter_mut()
106106
}
107107
}
108+
109+
#[cfg(test)]
110+
mod tests {
111+
use crate::{Array, sizes::U3};
112+
113+
#[test]
114+
fn mut_array_ref_into_iterator() {
115+
let array_ref: &mut Array<u8, U3> = &mut Array([1, 2, 3]);
116+
let mut iter = array_ref.into_iter();
117+
118+
for i in 1..=3 {
119+
assert_eq!(iter.next().copied(), Some(i));
120+
}
121+
122+
assert_eq!(iter.next(), None);
123+
}
124+
125+
#[cfg(feature = "alloc")]
126+
#[test]
127+
fn display_try_from_iterator_error() {
128+
use super::TryFromIteratorError;
129+
use alloc::string::ToString;
130+
let _ = TryFromIteratorError.to_string();
131+
}
132+
}

0 commit comments

Comments
 (0)