#[cfg(test)]
+use std::io::BufRead;
+#[cfg(test)]
use std::iter::Iterator;
#[derive(Debug, PartialEq, Eq)]
}
#[cfg(test)]
-fn read_rows(_input: &impl std::io::Read) -> impl Iterator<Item = RowInput> {
+fn read_rows(input: impl std::io::Read) -> impl Iterator<Item = RowInput> {
vec![RowInput {
- label: String::from("foo"),
+ label: std::io::BufReader::new(input)
+ .lines()
+ .nth(0)
+ .unwrap()
+ .unwrap(),
entries: vec![],
}]
.into_iter()
#[test]
fn test_read_rows() {
assert_eq!(
- read_rows(&&b"foo"[..]).collect::<Vec<_>>(),
+ read_rows(&b"foo"[..]).collect::<Vec<_>>(),
vec![RowInput {
label: String::from("foo"),
entries: vec![]
}]
);
+ assert_eq!(
+ read_rows(&b"bar"[..]).collect::<Vec<_>>(),
+ vec![RowInput {
+ label: String::from("bar"),
+ entries: vec![]
+ }]
+ );
}
}