#[cfg(test)]
fn read_rows(input: impl std::io::Read) -> impl Iterator<Item = RowInput> {
- vec![RowInput {
- label: std::io::BufReader::new(input)
- .lines()
- .nth(0)
- .unwrap()
- .unwrap(),
+ std::io::BufReader::new(input).lines().map(|line| RowInput {
+ label: line.unwrap(),
entries: vec![],
- }]
- .into_iter()
+ })
}
pub fn tablify(_input: &impl std::io::Read) -> String {
entries: vec![]
}]
);
+ assert_eq!(
+ read_rows(&b"foo\nbar\n"[..]).collect::<Vec<_>>(),
+ vec![
+ RowInput {
+ label: String::from("foo"),
+ entries: vec![]
+ },
+ RowInput {
+ label: String::from("bar"),
+ entries: vec![]
+ }
+ ]
+ );
}
}