Fix the graph ordering test case to check actual order and not just members as set

This commit is contained in:
Sheetal Nandi
2019-04-18 15:45:45 -07:00
parent b9eeaab050
commit 3e77b96824

View File

@@ -22,19 +22,19 @@ namespace ts {
});
it("orders the graph correctly - specify two roots", () => {
checkGraphOrdering(["A", "G"], ["A", "B", "C", "D", "E", "G"]);
checkGraphOrdering(["A", "G"], ["D", "E", "C", "B", "A", "G"]);
});
it("orders the graph correctly - multiple parts of the same graph in various orders", () => {
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"]);
checkGraphOrdering(["A"], ["D", "E", "C", "B", "A"]);
checkGraphOrdering(["A", "C", "D"], ["D", "E", "C", "B", "A"]);
checkGraphOrdering(["D", "C", "A"], ["D", "E", "C", "B", "A"]);
});
it("orders the graph correctly - other orderings", () => {
checkGraphOrdering(["F"], ["F", "E"]);
checkGraphOrdering(["F"], ["E", "F"]);
checkGraphOrdering(["E"], ["E"]);
checkGraphOrdering(["F", "C", "A"], ["A", "B", "C", "D", "E", "F"]);
checkGraphOrdering(["F", "C", "A"], ["E", "F", "D", "C", "B", "A"]);
});
function checkGraphOrdering(rootNames: string[], expectedBuildSet: string[]) {
@@ -43,7 +43,7 @@ namespace ts {
const projFileNames = rootNames.map(getProjectFileName);
const graph = builder.getBuildGraph(projFileNames);
assert.sameMembers(graph.buildQueue, expectedBuildSet.map(getProjectFileName));
assert.deepEqual(graph.buildQueue, expectedBuildSet.map(getProjectFileName));
for (const dep of deps) {
const child = getProjectFileName(dep[0]);