/// Common code for the toolchain integration tests. use hadron_sclang::toolchain::lexer; // Applies f to each file that matches pattern. pub fn for_each_file(pattern: &str, f: fn(&lexer::NamedBuffer)) { for path in glob::glob(pattern).unwrap() { let path = path.unwrap(); let bytes = std::fs::read(&path).unwrap(); let buffer = lexer::NamedBuffer { bytes: &bytes, name: path.to_str().unwrap() }; f(&buffer); } }