Resolve dependencies after the first (#149)

The recipe dependency resolver had a bug which caused it to not resolve
dependencies after the first.

This caused the parameter check later in the program to crash.

Added a test and fixed it.

Fixes #148.
This commit is contained in:
Casey Rodarmor 2017-01-18 20:32:55 -08:00 committed by GitHub
parent 1befc8674e
commit bed28c1df5
2 changed files with 20 additions and 1 deletions

View File

@ -1859,3 +1859,22 @@ BAZ +Z:
"echo bar: 0\necho foo: 1 2\necho baz: 3 4 5\n", "echo bar: 0\necho foo: 1 2\necho baz: 3 4 5\n",
); );
} }
#[test]
fn missing_second_dependency() {
integration_test(
&[],
"
x:
a: x y
",
255,
"",
"error: Recipe `a` has unknown dependency `y`
|
4 | a: x y
| ^
",
);
}

View File

@ -589,7 +589,7 @@ impl<'a, 'b> Resolver<'a, 'b> {
.cloned().collect() .cloned().collect()
})); }));
} }
return self.resolve(dependency); self.resolve(dependency)?;
}, },
None => return Err(dependency_token.error(ErrorKind::UnknownDependency { None => return Err(dependency_token.error(ErrorKind::UnknownDependency {
recipe: recipe.name, recipe: recipe.name,