reftest: Allow free-form comments

This commit is contained in:
Keegan McAllister 2014-02-12 16:14:35 -08:00
parent f8f17cf475
commit e70bac19e6

View file

@ -71,6 +71,11 @@ fn parse_lists(filenames: &[~str]) -> ~[TestDescAndFn] {
}; };
for line in contents.lines() { for line in contents.lines() {
// ignore comments
if line.starts_with("#") {
continue;
}
let parts: ~[&str] = line.split(' ').filter(|p| !p.is_empty()).collect(); let parts: ~[&str] = line.split(' ').filter(|p| !p.is_empty()).collect();
if parts.len() != 3 { if parts.len() != 3 {
@ -80,7 +85,6 @@ fn parse_lists(filenames: &[~str]) -> ~[TestDescAndFn] {
let kind = match parts[0] { let kind = match parts[0] {
"==" => Same, "==" => Same,
"!=" => Different, "!=" => Different,
"#" => continue,
_ => fail!("reftest line: '{:s}' has invalid kind '{:s}'", _ => fail!("reftest line: '{:s}' has invalid kind '{:s}'",
line, parts[0]) line, parts[0])
}; };