From e45c5dbceab76db9932f93dab4dd9aa70dcdf3c3 Mon Sep 17 00:00:00 2001 From: Marius Schulz Date: Sat, 19 Nov 2016 22:30:33 +0100 Subject: [PATCH] Add tests and accept new baselines --- .../intersectionTypeWithLeadingOperator.js | 8 ++++++++ .../intersectionTypeWithLeadingOperator.symbols | 13 +++++++++++++ .../intersectionTypeWithLeadingOperator.types | 13 +++++++++++++ .../reference/unionTypeWithLeadingOperator.js | 8 ++++++++ .../reference/unionTypeWithLeadingOperator.symbols | 13 +++++++++++++ .../reference/unionTypeWithLeadingOperator.types | 13 +++++++++++++ .../compiler/intersectionTypeWithLeadingOperator.ts | 4 ++++ .../cases/compiler/unionTypeWithLeadingOperator.ts | 4 ++++ 8 files changed, 76 insertions(+) create mode 100644 tests/baselines/reference/intersectionTypeWithLeadingOperator.js create mode 100644 tests/baselines/reference/intersectionTypeWithLeadingOperator.symbols create mode 100644 tests/baselines/reference/intersectionTypeWithLeadingOperator.types create mode 100644 tests/baselines/reference/unionTypeWithLeadingOperator.js create mode 100644 tests/baselines/reference/unionTypeWithLeadingOperator.symbols create mode 100644 tests/baselines/reference/unionTypeWithLeadingOperator.types create mode 100644 tests/cases/compiler/intersectionTypeWithLeadingOperator.ts create mode 100644 tests/cases/compiler/unionTypeWithLeadingOperator.ts diff --git a/tests/baselines/reference/intersectionTypeWithLeadingOperator.js b/tests/baselines/reference/intersectionTypeWithLeadingOperator.js new file mode 100644 index 00000000000..03f17c08788 --- /dev/null +++ b/tests/baselines/reference/intersectionTypeWithLeadingOperator.js @@ -0,0 +1,8 @@ +//// [intersectionTypeWithLeadingOperator.ts] +type A = & string; +type B = + & { foo: string } + & { bar: number }; + + +//// [intersectionTypeWithLeadingOperator.js] diff --git a/tests/baselines/reference/intersectionTypeWithLeadingOperator.symbols b/tests/baselines/reference/intersectionTypeWithLeadingOperator.symbols new file mode 100644 index 00000000000..43e0db684dc --- /dev/null +++ b/tests/baselines/reference/intersectionTypeWithLeadingOperator.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/intersectionTypeWithLeadingOperator.ts === +type A = & string; +>A : Symbol(A, Decl(intersectionTypeWithLeadingOperator.ts, 0, 0)) + +type B = +>B : Symbol(B, Decl(intersectionTypeWithLeadingOperator.ts, 0, 18)) + + & { foo: string } +>foo : Symbol(foo, Decl(intersectionTypeWithLeadingOperator.ts, 2, 5)) + + & { bar: number }; +>bar : Symbol(bar, Decl(intersectionTypeWithLeadingOperator.ts, 3, 5)) + diff --git a/tests/baselines/reference/intersectionTypeWithLeadingOperator.types b/tests/baselines/reference/intersectionTypeWithLeadingOperator.types new file mode 100644 index 00000000000..f2fad709dce --- /dev/null +++ b/tests/baselines/reference/intersectionTypeWithLeadingOperator.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/intersectionTypeWithLeadingOperator.ts === +type A = & string; +>A : string + +type B = +>B : B + + & { foo: string } +>foo : string + + & { bar: number }; +>bar : number + diff --git a/tests/baselines/reference/unionTypeWithLeadingOperator.js b/tests/baselines/reference/unionTypeWithLeadingOperator.js new file mode 100644 index 00000000000..b6a40440a48 --- /dev/null +++ b/tests/baselines/reference/unionTypeWithLeadingOperator.js @@ -0,0 +1,8 @@ +//// [unionTypeWithLeadingOperator.ts] +type A = | string; +type B = + | { type: "INCREMENT" } + | { type: "DECREMENT" }; + + +//// [unionTypeWithLeadingOperator.js] diff --git a/tests/baselines/reference/unionTypeWithLeadingOperator.symbols b/tests/baselines/reference/unionTypeWithLeadingOperator.symbols new file mode 100644 index 00000000000..97fdcdda8e0 --- /dev/null +++ b/tests/baselines/reference/unionTypeWithLeadingOperator.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/unionTypeWithLeadingOperator.ts === +type A = | string; +>A : Symbol(A, Decl(unionTypeWithLeadingOperator.ts, 0, 0)) + +type B = +>B : Symbol(B, Decl(unionTypeWithLeadingOperator.ts, 0, 18)) + + | { type: "INCREMENT" } +>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 2, 5)) + + | { type: "DECREMENT" }; +>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 3, 5)) + diff --git a/tests/baselines/reference/unionTypeWithLeadingOperator.types b/tests/baselines/reference/unionTypeWithLeadingOperator.types new file mode 100644 index 00000000000..db92c6e8eb6 --- /dev/null +++ b/tests/baselines/reference/unionTypeWithLeadingOperator.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/unionTypeWithLeadingOperator.ts === +type A = | string; +>A : string + +type B = +>B : B + + | { type: "INCREMENT" } +>type : "INCREMENT" + + | { type: "DECREMENT" }; +>type : "DECREMENT" + diff --git a/tests/cases/compiler/intersectionTypeWithLeadingOperator.ts b/tests/cases/compiler/intersectionTypeWithLeadingOperator.ts new file mode 100644 index 00000000000..9f64cad38dc --- /dev/null +++ b/tests/cases/compiler/intersectionTypeWithLeadingOperator.ts @@ -0,0 +1,4 @@ +type A = & string; +type B = + & { foo: string } + & { bar: number }; diff --git a/tests/cases/compiler/unionTypeWithLeadingOperator.ts b/tests/cases/compiler/unionTypeWithLeadingOperator.ts new file mode 100644 index 00000000000..08a876493d0 --- /dev/null +++ b/tests/cases/compiler/unionTypeWithLeadingOperator.ts @@ -0,0 +1,4 @@ +type A = | string; +type B = + | { type: "INCREMENT" } + | { type: "DECREMENT" };