Add graph ordering tests

This commit is contained in:
Ryan Cavanaugh
2018-05-29 10:00:54 -07:00
parent a7fcbcd3a4
commit 70fa29b627
2 changed files with 9 additions and 2 deletions

View File

@@ -650,7 +650,6 @@ namespace ts {
}
}
// TODO Accept parsedCommandLine instead?
function buildSingleProject(proj: ResolvedConfigFileName): BuildResultFlags {
if (context.options.dry) {
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Would_build_project_0, proj));

View File

@@ -228,7 +228,15 @@ namespace ts {
});
it("orders the graph correctly - multiple parts of the same graph in various orders", () => {
// TODO add cases here
checkGraphOrdering(["A"], ["A", "B", "C", "D", "E"]);
checkGraphOrdering(["A", "C", "D"], ["A", "B", "C", "D", "E"]);
checkGraphOrdering(["D", "C", "A"], ["A", "B", "C", "D", "E"]);
});
it("orders the graph correctly - other orderings", () => {
checkGraphOrdering(["F"], ["F", "E"]);
checkGraphOrdering(["E"], ["E"]);
checkGraphOrdering(["F", "C", "A"], ["A", "B", "C", "D", "E", "F"]);
});
function checkGraphOrdering(rootNames: string[], expectedBuildSet: string[]) {