#[cfg(test)] mod tests { use std::fs::File; use std::io::BufReader; #[test] fn find_matches_test() { let mut result = Vec::new(); let f = File::open("test.txt").expect("could not read file"); let content = BufReader::new(f); grrrrrrs::find_matches(content, "ip", &mut result); assert_eq!(result, b"rem ipsum\n"); } }