Check only one fixture

This commit is contained in:
Edwin Cheng 2020-03-10 22:52:43 +08:00
parent 773f3afd36
commit 95ba7da1ab

View file

@ -207,7 +207,12 @@ pub fn parse_single_fixture(fixture: &str) -> Option<FixtureEntry> {
if !fixture.lines().any(|it| it.trim_start().starts_with("//-")) { if !fixture.lines().any(|it| it.trim_start().starts_with("//-")) {
return None; return None;
} }
parse_fixture(fixture).into_iter().nth(0)
let fixtures = parse_fixture(fixture);
if fixtures.len() > 1 {
panic!("too many fixtures");
}
fixtures.into_iter().nth(0)
} }
// Comparison functionality borrowed from cargo: // Comparison functionality borrowed from cargo: