mirror of
https://github.com/github/semantic.git
synced 2024-12-01 00:33:59 +03:00
Add interface, intersection, union type tests
This commit is contained in:
parent
3d27c9dd3e
commit
31361d2306
1
test/fixtures/typescript/interfaces.A.ts
vendored
Normal file
1
test/fixtures/typescript/interfaces.A.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
interface Bar {}
|
3
test/fixtures/typescript/interfaces.B.ts
vendored
Normal file
3
test/fixtures/typescript/interfaces.B.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
module B {
|
||||
|
||||
}
|
4
test/fixtures/typescript/interfaces.diff+A.txt
vendored
Normal file
4
test/fixtures/typescript/interfaces.diff+A.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{+(Program
|
||||
(Other "interface_declaration"
|
||||
(Identifier)
|
||||
(Other "object_type")))+}
|
3
test/fixtures/typescript/interfaces.diff+B.txt
vendored
Normal file
3
test/fixtures/typescript/interfaces.diff+B.txt
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{+(Program
|
||||
(Other "module"
|
||||
(Identifier)))+}
|
4
test/fixtures/typescript/interfaces.diff-A.txt
vendored
Normal file
4
test/fixtures/typescript/interfaces.diff-A.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{-(Program
|
||||
(Other "interface_declaration"
|
||||
(Identifier)
|
||||
(Other "object_type")))-}
|
3
test/fixtures/typescript/interfaces.diff-B.txt
vendored
Normal file
3
test/fixtures/typescript/interfaces.diff-B.txt
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{-(Program
|
||||
(Other "module"
|
||||
(Identifier)))-}
|
6
test/fixtures/typescript/interfaces.diffA-B.txt
vendored
Normal file
6
test/fixtures/typescript/interfaces.diffA-B.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
{+(Other "module"
|
||||
(Identifier))+}
|
||||
{-(Other "interface_declaration"
|
||||
(Identifier)
|
||||
(Other "object_type"))-})
|
6
test/fixtures/typescript/interfaces.diffB-A.txt
vendored
Normal file
6
test/fixtures/typescript/interfaces.diffB-A.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
{+(Other "interface_declaration"
|
||||
(Identifier)
|
||||
(Other "object_type"))+}
|
||||
{-(Other "module"
|
||||
(Identifier))-})
|
4
test/fixtures/typescript/interfaces.parseA.txt
vendored
Normal file
4
test/fixtures/typescript/interfaces.parseA.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
(Program
|
||||
(Other "interface_declaration"
|
||||
(Identifier)
|
||||
(Other "object_type")))
|
3
test/fixtures/typescript/interfaces.parseB.txt
vendored
Normal file
3
test/fixtures/typescript/interfaces.parseB.txt
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
(Program
|
||||
(Other "module"
|
||||
(Identifier)))
|
1
test/fixtures/typescript/intersection-type.A.ts
vendored
Normal file
1
test/fixtures/typescript/intersection-type.A.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
let x: Foo | Bar;
|
1
test/fixtures/typescript/intersection-type.B.ts
vendored
Normal file
1
test/fixtures/typescript/intersection-type.B.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
let x: A & B;
|
10
test/fixtures/typescript/intersection-type.diff+A.txt
vendored
Normal file
10
test/fixtures/typescript/intersection-type.diff+A.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{+(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "union_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))+}
|
10
test/fixtures/typescript/intersection-type.diff+B.txt
vendored
Normal file
10
test/fixtures/typescript/intersection-type.diff+B.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{+(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "intersection_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))+}
|
10
test/fixtures/typescript/intersection-type.diff-A.txt
vendored
Normal file
10
test/fixtures/typescript/intersection-type.diff-A.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{-(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "union_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))-}
|
10
test/fixtures/typescript/intersection-type.diff-B.txt
vendored
Normal file
10
test/fixtures/typescript/intersection-type.diff-B.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{-(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "intersection_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))-}
|
12
test/fixtures/typescript/intersection-type.diffA-B.txt
vendored
Normal file
12
test/fixtures/typescript/intersection-type.diffA-B.txt
vendored
Normal file
@ -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) }))))))
|
12
test/fixtures/typescript/intersection-type.diffB-A.txt
vendored
Normal file
12
test/fixtures/typescript/intersection-type.diffB-A.txt
vendored
Normal file
@ -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) }))))))
|
10
test/fixtures/typescript/intersection-type.parseA.txt
vendored
Normal file
10
test/fixtures/typescript/intersection-type.parseA.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "union_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))
|
10
test/fixtures/typescript/intersection-type.parseB.txt
vendored
Normal file
10
test/fixtures/typescript/intersection-type.parseB.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "intersection_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))
|
1
test/fixtures/typescript/union-type.A.ts
vendored
Normal file
1
test/fixtures/typescript/union-type.A.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
let x: A & B;
|
1
test/fixtures/typescript/union-type.B.ts
vendored
Normal file
1
test/fixtures/typescript/union-type.B.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
let x: typeof A;
|
10
test/fixtures/typescript/union-type.diff+A.txt
vendored
Normal file
10
test/fixtures/typescript/union-type.diff+A.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{+(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "intersection_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))+}
|
7
test/fixtures/typescript/union-type.diff+B.txt
vendored
Normal file
7
test/fixtures/typescript/union-type.diff+B.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{+(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "type_query"
|
||||
(Identifier))))))+}
|
10
test/fixtures/typescript/union-type.diff-A.txt
vendored
Normal file
10
test/fixtures/typescript/union-type.diff-A.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{-(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "intersection_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))-}
|
7
test/fixtures/typescript/union-type.diff-B.txt
vendored
Normal file
7
test/fixtures/typescript/union-type.diff-B.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{-(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "type_query"
|
||||
(Identifier))))))-}
|
11
test/fixtures/typescript/union-type.diffA-B.txt
vendored
Normal file
11
test/fixtures/typescript/union-type.diffA-B.txt
vendored
Normal file
@ -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))-})))))
|
11
test/fixtures/typescript/union-type.diffB-A.txt
vendored
Normal file
11
test/fixtures/typescript/union-type.diffB-A.txt
vendored
Normal file
@ -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)-})))))
|
10
test/fixtures/typescript/union-type.parseA.txt
vendored
Normal file
10
test/fixtures/typescript/union-type.parseA.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "intersection_type"
|
||||
(Other "type_reference"
|
||||
(Identifier))
|
||||
(Other "type_reference"
|
||||
(Identifier)))))))
|
7
test/fixtures/typescript/union-type.parseB.txt
vendored
Normal file
7
test/fixtures/typescript/union-type.parseB.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(Other "lexical_declaration"
|
||||
(Other "variable_declarator"
|
||||
(Identifier)
|
||||
(Ty
|
||||
(Other "type_query"
|
||||
(Identifier))))))
|
Loading…
Reference in New Issue
Block a user