From 70fa29b627af7192ac0a78b73e4ae242f8169a72 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 29 May 2018 10:00:54 -0700 Subject: [PATCH] Add graph ordering tests --- src/compiler/tsbuild.ts | 1 - src/harness/unittests/tsbuild.ts | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 8e50800fff6..978aa102c8a 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -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)); diff --git a/src/harness/unittests/tsbuild.ts b/src/harness/unittests/tsbuild.ts index 08818d6ac3f..ed1fd967952 100644 --- a/src/harness/unittests/tsbuild.ts +++ b/src/harness/unittests/tsbuild.ts @@ -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[]) {