JavaScript: add tests for "import" types

This commit is contained in:
Asger F
2018-08-17 12:59:25 +01:00
parent c902a4e880
commit 3806e4b1aa
6 changed files with 27 additions and 0 deletions

View File

@@ -7,3 +7,5 @@
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 1 | 3 | tst.ts:69:39:69:44 | string |
| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 2 | 3 | tst.ts:69:47:69:53 | boolean |
| tst.ts:80:41:80:55 | Generic<Leaf[]> | tst.ts:80:41:80:47 | Generic | 0 | 1 | tst.ts:80:49:80:54 | Leaf[] |
| tst.ts:123:26:123:47 | import( ... string> | tst.ts:123:26:123:39 | import("type") | 0 | 1 | tst.ts:123:41:123:46 | string |
| tst.ts:125:35:125:65 | import( ... string> | tst.ts:125:55:125:57 | Foo | 0 | 1 | tst.ts:125:59:125:64 | string |

View File

@@ -3,3 +3,6 @@
| tst.ts:66:18:66:32 | N.InnerGeneric1 | tst.ts:66:18:66:18 | N | tst.ts:66:20:66:32 | InnerGeneric1 |
| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | tst.ts:67:18:67:20 | N.M | tst.ts:67:22:67:34 | InnerGeneric2 |
| tst.ts:68:26:68:40 | N.InnerGeneric1 | tst.ts:68:26:68:26 | N | tst.ts:68:28:68:40 | InnerGeneric1 |
| tst.ts:124:48:124:50 | Foo | tst.ts:124:28:124:46 | import("namespace") | tst.ts:124:48:124:50 | Foo |
| tst.ts:125:55:125:57 | Foo | tst.ts:125:35:125:53 | import("namespace") | tst.ts:125:55:125:57 | Foo |
| tst.ts:131:4:131:6 | bar | tst.ts:128:38:130:3 | import( ... ce'\\n ) | tst.ts:131:4:131:6 | bar |

View File

@@ -7,3 +7,5 @@
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 1 | tst.ts:69:39:69:44 | string |
| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 2 | tst.ts:69:47:69:53 | boolean |
| tst.ts:80:41:80:47 | Generic | 1 | 0 | tst.ts:80:49:80:54 | Leaf[] |
| tst.ts:123:26:123:39 | import("type") | 1 | 0 | tst.ts:123:41:123:46 | string |
| tst.ts:125:55:125:57 | Foo | 1 | 0 | tst.ts:125:59:125:64 | string |

View File

@@ -2,3 +2,5 @@
| tst.ts:71:17:71:26 | typeof N.x | tst.ts:71:24:71:26 | N.x |
| tst.ts:72:17:72:35 | typeof qualifiedVar | tst.ts:72:24:72:35 | qualifiedVar |
| tst.ts:81:43:81:50 | typeof x | tst.ts:81:50:81:50 | x |
| tst.ts:126:21:126:42 | typeof ... value") | tst.ts:126:28:126:42 | import("value") |
| tst.ts:127:30:127:53 | typeof ... lue").x | tst.ts:127:53:127:53 | x |

View File

@@ -62,3 +62,10 @@
| tst.ts:114:5:114:15 | mappedType2 | mappedType2 | tst.ts:114:18:114:41 | { [K in ... umber } |
| tst.ts:116:35:116:35 | x | x | tst.ts:116:38:116:43 | number |
| tst.ts:116:46:116:46 | y | y | tst.ts:116:49:116:54 | string |
| tst.ts:122:5:122:16 | importedType | importedType | tst.ts:122:19:122:32 | import("type") |
| tst.ts:123:5:123:23 | importedTypeGeneric | importedTypeGeneric | tst.ts:123:26:123:47 | import( ... string> |
| tst.ts:124:5:124:25 | importe ... iedType | importedQualifiedType | tst.ts:124:48:124:50 | Foo |
| tst.ts:125:5:125:32 | importe ... Generic | importedQualifiedTypeGeneric | tst.ts:125:35:125:65 | import( ... string> |
| tst.ts:126:5:126:18 | importedTypeof | importedTypeof | tst.ts:126:21:126:42 | typeof ... value") |
| tst.ts:127:5:127:27 | importe ... dTypeof | importedQualifiedTypeof | tst.ts:127:30:127:53 | typeof ... lue").x |
| tst.ts:128:5:128:35 | importe ... tespace | importedQualifiedTypeWhitespace | tst.ts:131:4:131:6 | bar |

View File

@@ -118,3 +118,14 @@ function hasThisParam(this: void, x: number, y: string) {}
interface InterfaceWithThisParam {
hasThisParam(this: InterfaceWithThisParam);
}
var importedType: import("type");
var importedTypeGeneric: import("type")<string>;
var importedQualifiedType: import("namespace").Foo;
var importedQualifiedTypeGeneric: import("namespace").Foo<string>;
var importedTypeof: typeof import("value");
var importedQualifiedTypeof: typeof import("value").x;
var importedQualifiedTypeWhitespace: import(
'awkard-namespace'
)
.bar;