1
1
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:
joshvera 2017-03-27 17:54:37 -04:00
parent 3d27c9dd3e
commit 31361d2306
30 changed files with 198 additions and 0 deletions

View File

@ -0,0 +1 @@
interface Bar {}

View File

@ -0,0 +1,3 @@
module B {
}

View File

@ -0,0 +1,4 @@
{+(Program
(Other "interface_declaration"
(Identifier)
(Other "object_type")))+}

View File

@ -0,0 +1,3 @@
{+(Program
(Other "module"
(Identifier)))+}

View File

@ -0,0 +1,4 @@
{-(Program
(Other "interface_declaration"
(Identifier)
(Other "object_type")))-}

View File

@ -0,0 +1,3 @@
{-(Program
(Other "module"
(Identifier)))-}

View File

@ -0,0 +1,6 @@
(Program
{+(Other "module"
(Identifier))+}
{-(Other "interface_declaration"
(Identifier)
(Other "object_type"))-})

View File

@ -0,0 +1,6 @@
(Program
{+(Other "interface_declaration"
(Identifier)
(Other "object_type"))+}
{-(Other "module"
(Identifier))-})

View File

@ -0,0 +1,4 @@
(Program
(Other "interface_declaration"
(Identifier)
(Other "object_type")))

View File

@ -0,0 +1,3 @@
(Program
(Other "module"
(Identifier)))

View File

@ -0,0 +1 @@
let x: Foo | Bar;

View File

@ -0,0 +1 @@
let x: A & B;

View 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)))))))+}

View 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)))))))+}

View 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)))))))-}

View 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)))))))-}

View 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) }))))))

View 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) }))))))

View 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)))))))

View 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)))))))

View File

@ -0,0 +1 @@
let x: A & B;

View File

@ -0,0 +1 @@
let x: typeof A;

View 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)))))))+}

View File

@ -0,0 +1,7 @@
{+(Program
(Other "lexical_declaration"
(Other "variable_declarator"
(Identifier)
(Ty
(Other "type_query"
(Identifier))))))+}

View 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)))))))-}

View File

@ -0,0 +1,7 @@
{-(Program
(Other "lexical_declaration"
(Other "variable_declarator"
(Identifier)
(Ty
(Other "type_query"
(Identifier))))))-}

View 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))-})))))

View 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)-})))))

View 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)))))))

View File

@ -0,0 +1,7 @@
(Program
(Other "lexical_declaration"
(Other "variable_declarator"
(Identifier)
(Ty
(Other "type_query"
(Identifier))))))