From 31361d230669cfdd979edfa60aab0654db936a42 Mon Sep 17 00:00:00 2001 From: joshvera Date: Mon, 27 Mar 2017 17:54:37 -0400 Subject: [PATCH] Add interface, intersection, union type tests --- test/fixtures/typescript/interfaces.A.ts | 1 + test/fixtures/typescript/interfaces.B.ts | 3 +++ test/fixtures/typescript/interfaces.diff+A.txt | 4 ++++ test/fixtures/typescript/interfaces.diff+B.txt | 3 +++ test/fixtures/typescript/interfaces.diff-A.txt | 4 ++++ test/fixtures/typescript/interfaces.diff-B.txt | 3 +++ test/fixtures/typescript/interfaces.diffA-B.txt | 6 ++++++ test/fixtures/typescript/interfaces.diffB-A.txt | 6 ++++++ test/fixtures/typescript/interfaces.parseA.txt | 4 ++++ test/fixtures/typescript/interfaces.parseB.txt | 3 +++ test/fixtures/typescript/intersection-type.A.ts | 1 + test/fixtures/typescript/intersection-type.B.ts | 1 + .../fixtures/typescript/intersection-type.diff+A.txt | 10 ++++++++++ .../fixtures/typescript/intersection-type.diff+B.txt | 10 ++++++++++ .../fixtures/typescript/intersection-type.diff-A.txt | 10 ++++++++++ .../fixtures/typescript/intersection-type.diff-B.txt | 10 ++++++++++ .../typescript/intersection-type.diffA-B.txt | 12 ++++++++++++ .../typescript/intersection-type.diffB-A.txt | 12 ++++++++++++ .../fixtures/typescript/intersection-type.parseA.txt | 10 ++++++++++ .../fixtures/typescript/intersection-type.parseB.txt | 10 ++++++++++ test/fixtures/typescript/union-type.A.ts | 1 + test/fixtures/typescript/union-type.B.ts | 1 + test/fixtures/typescript/union-type.diff+A.txt | 10 ++++++++++ test/fixtures/typescript/union-type.diff+B.txt | 7 +++++++ test/fixtures/typescript/union-type.diff-A.txt | 10 ++++++++++ test/fixtures/typescript/union-type.diff-B.txt | 7 +++++++ test/fixtures/typescript/union-type.diffA-B.txt | 11 +++++++++++ test/fixtures/typescript/union-type.diffB-A.txt | 11 +++++++++++ test/fixtures/typescript/union-type.parseA.txt | 10 ++++++++++ test/fixtures/typescript/union-type.parseB.txt | 7 +++++++ 30 files changed, 198 insertions(+) create mode 100644 test/fixtures/typescript/interfaces.A.ts create mode 100644 test/fixtures/typescript/interfaces.B.ts create mode 100644 test/fixtures/typescript/interfaces.diff+A.txt create mode 100644 test/fixtures/typescript/interfaces.diff+B.txt create mode 100644 test/fixtures/typescript/interfaces.diff-A.txt create mode 100644 test/fixtures/typescript/interfaces.diff-B.txt create mode 100644 test/fixtures/typescript/interfaces.diffA-B.txt create mode 100644 test/fixtures/typescript/interfaces.diffB-A.txt create mode 100644 test/fixtures/typescript/interfaces.parseA.txt create mode 100644 test/fixtures/typescript/interfaces.parseB.txt create mode 100644 test/fixtures/typescript/intersection-type.A.ts create mode 100644 test/fixtures/typescript/intersection-type.B.ts create mode 100644 test/fixtures/typescript/intersection-type.diff+A.txt create mode 100644 test/fixtures/typescript/intersection-type.diff+B.txt create mode 100644 test/fixtures/typescript/intersection-type.diff-A.txt create mode 100644 test/fixtures/typescript/intersection-type.diff-B.txt create mode 100644 test/fixtures/typescript/intersection-type.diffA-B.txt create mode 100644 test/fixtures/typescript/intersection-type.diffB-A.txt create mode 100644 test/fixtures/typescript/intersection-type.parseA.txt create mode 100644 test/fixtures/typescript/intersection-type.parseB.txt create mode 100644 test/fixtures/typescript/union-type.A.ts create mode 100644 test/fixtures/typescript/union-type.B.ts create mode 100644 test/fixtures/typescript/union-type.diff+A.txt create mode 100644 test/fixtures/typescript/union-type.diff+B.txt create mode 100644 test/fixtures/typescript/union-type.diff-A.txt create mode 100644 test/fixtures/typescript/union-type.diff-B.txt create mode 100644 test/fixtures/typescript/union-type.diffA-B.txt create mode 100644 test/fixtures/typescript/union-type.diffB-A.txt create mode 100644 test/fixtures/typescript/union-type.parseA.txt create mode 100644 test/fixtures/typescript/union-type.parseB.txt diff --git a/test/fixtures/typescript/interfaces.A.ts b/test/fixtures/typescript/interfaces.A.ts new file mode 100644 index 000000000..9a291e7c9 --- /dev/null +++ b/test/fixtures/typescript/interfaces.A.ts @@ -0,0 +1 @@ +interface Bar {} diff --git a/test/fixtures/typescript/interfaces.B.ts b/test/fixtures/typescript/interfaces.B.ts new file mode 100644 index 000000000..7b9d9d91a --- /dev/null +++ b/test/fixtures/typescript/interfaces.B.ts @@ -0,0 +1,3 @@ +module B { + +} \ No newline at end of file diff --git a/test/fixtures/typescript/interfaces.diff+A.txt b/test/fixtures/typescript/interfaces.diff+A.txt new file mode 100644 index 000000000..896fce6b4 --- /dev/null +++ b/test/fixtures/typescript/interfaces.diff+A.txt @@ -0,0 +1,4 @@ +{+(Program + (Other "interface_declaration" + (Identifier) + (Other "object_type")))+} diff --git a/test/fixtures/typescript/interfaces.diff+B.txt b/test/fixtures/typescript/interfaces.diff+B.txt new file mode 100644 index 000000000..333adb08d --- /dev/null +++ b/test/fixtures/typescript/interfaces.diff+B.txt @@ -0,0 +1,3 @@ +{+(Program + (Other "module" + (Identifier)))+} diff --git a/test/fixtures/typescript/interfaces.diff-A.txt b/test/fixtures/typescript/interfaces.diff-A.txt new file mode 100644 index 000000000..834e61152 --- /dev/null +++ b/test/fixtures/typescript/interfaces.diff-A.txt @@ -0,0 +1,4 @@ +{-(Program + (Other "interface_declaration" + (Identifier) + (Other "object_type")))-} diff --git a/test/fixtures/typescript/interfaces.diff-B.txt b/test/fixtures/typescript/interfaces.diff-B.txt new file mode 100644 index 000000000..7dbb03e74 --- /dev/null +++ b/test/fixtures/typescript/interfaces.diff-B.txt @@ -0,0 +1,3 @@ +{-(Program + (Other "module" + (Identifier)))-} diff --git a/test/fixtures/typescript/interfaces.diffA-B.txt b/test/fixtures/typescript/interfaces.diffA-B.txt new file mode 100644 index 000000000..1ecc58c7c --- /dev/null +++ b/test/fixtures/typescript/interfaces.diffA-B.txt @@ -0,0 +1,6 @@ +(Program +{+(Other "module" + (Identifier))+} +{-(Other "interface_declaration" + (Identifier) + (Other "object_type"))-}) diff --git a/test/fixtures/typescript/interfaces.diffB-A.txt b/test/fixtures/typescript/interfaces.diffB-A.txt new file mode 100644 index 000000000..14d916f00 --- /dev/null +++ b/test/fixtures/typescript/interfaces.diffB-A.txt @@ -0,0 +1,6 @@ +(Program +{+(Other "interface_declaration" + (Identifier) + (Other "object_type"))+} +{-(Other "module" + (Identifier))-}) diff --git a/test/fixtures/typescript/interfaces.parseA.txt b/test/fixtures/typescript/interfaces.parseA.txt new file mode 100644 index 000000000..eb711acf0 --- /dev/null +++ b/test/fixtures/typescript/interfaces.parseA.txt @@ -0,0 +1,4 @@ +(Program + (Other "interface_declaration" + (Identifier) + (Other "object_type"))) diff --git a/test/fixtures/typescript/interfaces.parseB.txt b/test/fixtures/typescript/interfaces.parseB.txt new file mode 100644 index 000000000..fb8c2dff6 --- /dev/null +++ b/test/fixtures/typescript/interfaces.parseB.txt @@ -0,0 +1,3 @@ +(Program + (Other "module" + (Identifier))) diff --git a/test/fixtures/typescript/intersection-type.A.ts b/test/fixtures/typescript/intersection-type.A.ts new file mode 100644 index 000000000..f1cd3977e --- /dev/null +++ b/test/fixtures/typescript/intersection-type.A.ts @@ -0,0 +1 @@ +let x: Foo | Bar; \ No newline at end of file diff --git a/test/fixtures/typescript/intersection-type.B.ts b/test/fixtures/typescript/intersection-type.B.ts new file mode 100644 index 000000000..a4f8ba805 --- /dev/null +++ b/test/fixtures/typescript/intersection-type.B.ts @@ -0,0 +1 @@ +let x: A & B; \ No newline at end of file diff --git a/test/fixtures/typescript/intersection-type.diff+A.txt b/test/fixtures/typescript/intersection-type.diff+A.txt new file mode 100644 index 000000000..f45448e41 --- /dev/null +++ b/test/fixtures/typescript/intersection-type.diff+A.txt @@ -0,0 +1,10 @@ +{+(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "union_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier)))))))+} diff --git a/test/fixtures/typescript/intersection-type.diff+B.txt b/test/fixtures/typescript/intersection-type.diff+B.txt new file mode 100644 index 000000000..9589863bc --- /dev/null +++ b/test/fixtures/typescript/intersection-type.diff+B.txt @@ -0,0 +1,10 @@ +{+(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier)))))))+} diff --git a/test/fixtures/typescript/intersection-type.diff-A.txt b/test/fixtures/typescript/intersection-type.diff-A.txt new file mode 100644 index 000000000..558e12d90 --- /dev/null +++ b/test/fixtures/typescript/intersection-type.diff-A.txt @@ -0,0 +1,10 @@ +{-(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "union_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier)))))))-} diff --git a/test/fixtures/typescript/intersection-type.diff-B.txt b/test/fixtures/typescript/intersection-type.diff-B.txt new file mode 100644 index 000000000..edce39f03 --- /dev/null +++ b/test/fixtures/typescript/intersection-type.diff-B.txt @@ -0,0 +1,10 @@ +{-(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier)))))))-} diff --git a/test/fixtures/typescript/intersection-type.diffA-B.txt b/test/fixtures/typescript/intersection-type.diffA-B.txt new file mode 100644 index 000000000..29d30ef00 --- /dev/null +++ b/test/fixtures/typescript/intersection-type.diffA-B.txt @@ -0,0 +1,12 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + (Other "type_reference" + { (Identifier) + ->(Identifier) }) + (Other "type_reference" + { (Identifier) + ->(Identifier) })))))) diff --git a/test/fixtures/typescript/intersection-type.diffB-A.txt b/test/fixtures/typescript/intersection-type.diffB-A.txt new file mode 100644 index 000000000..37c74812d --- /dev/null +++ b/test/fixtures/typescript/intersection-type.diffB-A.txt @@ -0,0 +1,12 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "union_type" + (Other "type_reference" + { (Identifier) + ->(Identifier) }) + (Other "type_reference" + { (Identifier) + ->(Identifier) })))))) diff --git a/test/fixtures/typescript/intersection-type.parseA.txt b/test/fixtures/typescript/intersection-type.parseA.txt new file mode 100644 index 000000000..a3f05d2ed --- /dev/null +++ b/test/fixtures/typescript/intersection-type.parseA.txt @@ -0,0 +1,10 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "union_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier))))))) diff --git a/test/fixtures/typescript/intersection-type.parseB.txt b/test/fixtures/typescript/intersection-type.parseB.txt new file mode 100644 index 000000000..fa6d2d443 --- /dev/null +++ b/test/fixtures/typescript/intersection-type.parseB.txt @@ -0,0 +1,10 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier))))))) diff --git a/test/fixtures/typescript/union-type.A.ts b/test/fixtures/typescript/union-type.A.ts new file mode 100644 index 000000000..a4f8ba805 --- /dev/null +++ b/test/fixtures/typescript/union-type.A.ts @@ -0,0 +1 @@ +let x: A & B; \ No newline at end of file diff --git a/test/fixtures/typescript/union-type.B.ts b/test/fixtures/typescript/union-type.B.ts new file mode 100644 index 000000000..301bd3372 --- /dev/null +++ b/test/fixtures/typescript/union-type.B.ts @@ -0,0 +1 @@ +let x: typeof A; \ No newline at end of file diff --git a/test/fixtures/typescript/union-type.diff+A.txt b/test/fixtures/typescript/union-type.diff+A.txt new file mode 100644 index 000000000..9589863bc --- /dev/null +++ b/test/fixtures/typescript/union-type.diff+A.txt @@ -0,0 +1,10 @@ +{+(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier)))))))+} diff --git a/test/fixtures/typescript/union-type.diff+B.txt b/test/fixtures/typescript/union-type.diff+B.txt new file mode 100644 index 000000000..c90c3e312 --- /dev/null +++ b/test/fixtures/typescript/union-type.diff+B.txt @@ -0,0 +1,7 @@ +{+(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "type_query" + (Identifier))))))+} diff --git a/test/fixtures/typescript/union-type.diff-A.txt b/test/fixtures/typescript/union-type.diff-A.txt new file mode 100644 index 000000000..edce39f03 --- /dev/null +++ b/test/fixtures/typescript/union-type.diff-A.txt @@ -0,0 +1,10 @@ +{-(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier)))))))-} diff --git a/test/fixtures/typescript/union-type.diff-B.txt b/test/fixtures/typescript/union-type.diff-B.txt new file mode 100644 index 000000000..87ce5e61a --- /dev/null +++ b/test/fixtures/typescript/union-type.diff-B.txt @@ -0,0 +1,7 @@ +{-(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "type_query" + (Identifier))))))-} diff --git a/test/fixtures/typescript/union-type.diffA-B.txt b/test/fixtures/typescript/union-type.diffA-B.txt new file mode 100644 index 000000000..e4a3ecb41 --- /dev/null +++ b/test/fixtures/typescript/union-type.diffA-B.txt @@ -0,0 +1,11 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "type_query" + {+(Identifier)+} + {-(Other "type_reference" + (Identifier))-} + {-(Other "type_reference" + (Identifier))-}))))) diff --git a/test/fixtures/typescript/union-type.diffB-A.txt b/test/fixtures/typescript/union-type.diffB-A.txt new file mode 100644 index 000000000..e5cd8a881 --- /dev/null +++ b/test/fixtures/typescript/union-type.diffB-A.txt @@ -0,0 +1,11 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + {+(Other "type_reference" + (Identifier))+} + {+(Other "type_reference" + (Identifier))+} + {-(Identifier)-}))))) diff --git a/test/fixtures/typescript/union-type.parseA.txt b/test/fixtures/typescript/union-type.parseA.txt new file mode 100644 index 000000000..fa6d2d443 --- /dev/null +++ b/test/fixtures/typescript/union-type.parseA.txt @@ -0,0 +1,10 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "intersection_type" + (Other "type_reference" + (Identifier)) + (Other "type_reference" + (Identifier))))))) diff --git a/test/fixtures/typescript/union-type.parseB.txt b/test/fixtures/typescript/union-type.parseB.txt new file mode 100644 index 000000000..f7def4c67 --- /dev/null +++ b/test/fixtures/typescript/union-type.parseB.txt @@ -0,0 +1,7 @@ +(Program + (Other "lexical_declaration" + (Other "variable_declarator" + (Identifier) + (Ty + (Other "type_query" + (Identifier))))))