Add grammar walker test coverage cases.
This commit is contained in:
parent
05dc93462c
commit
66c1b3df20
|
@ -0,0 +1,7 @@
|
||||||
|
tests/cases/compiler/accessorWithoutBody1.ts(1,19): error TS1005: '{' expected.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/accessorWithoutBody1.ts (1 errors) ====
|
||||||
|
var v = { get foo() }
|
||||||
|
~
|
||||||
|
!!! error TS1005: '{' expected.
|
|
@ -0,0 +1,7 @@
|
||||||
|
tests/cases/compiler/accessorWithoutBody2.ts(1,20): error TS1005: '{' expected.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/accessorWithoutBody2.ts (1 errors) ====
|
||||||
|
var v = { set foo(a) }
|
||||||
|
~
|
||||||
|
!!! error TS1005: '{' expected.
|
|
@ -0,0 +1,10 @@
|
||||||
|
tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts(1,7): error TS1110: Type expected.
|
||||||
|
tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts(1,1): error TS2304: Cannot find name 'Foo'.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts (2 errors) ====
|
||||||
|
Foo<a,,b>();
|
||||||
|
|
||||||
|
!!! error TS1110: Type expected.
|
||||||
|
~~~
|
||||||
|
!!! error TS2304: Cannot find name 'Foo'.
|
|
@ -0,0 +1,10 @@
|
||||||
|
tests/cases/compiler/declareModifierOnImport1.ts(1,1): error TS1079: A 'declare' modifier cannot be used with an import declaration.
|
||||||
|
tests/cases/compiler/declareModifierOnImport1.ts(1,1): error TS2304: Cannot find name 'b'.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/declareModifierOnImport1.ts (2 errors) ====
|
||||||
|
declare import a = b;
|
||||||
|
~~~~~~~
|
||||||
|
!!! error TS1079: A 'declare' modifier cannot be used with an import declaration.
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
!!! error TS2304: Cannot find name 'b'.
|
|
@ -0,0 +1,12 @@
|
||||||
|
tests/cases/compiler/indexSignatureWithInitializer1.ts(2,4): error TS1020: An index signature parameter cannot have an initializer.
|
||||||
|
tests/cases/compiler/indexSignatureWithInitializer1.ts(2,4): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/indexSignatureWithInitializer1.ts (2 errors) ====
|
||||||
|
class C {
|
||||||
|
[a: number = 1]: number;
|
||||||
|
~
|
||||||
|
!!! error TS1020: An index signature parameter cannot have an initializer.
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
//// [indexSignatureWithoutTypeAnnotation1..ts]
|
||||||
|
|
||||||
|
|
||||||
|
//// [indexSignatureWithoutTypeAnnotation1..js]
|
|
@ -0,0 +1,3 @@
|
||||||
|
=== tests/cases/compiler/indexSignatureWithoutTypeAnnotation1..ts ===
|
||||||
|
|
||||||
|
No type information for this code.
|
|
@ -0,0 +1,9 @@
|
||||||
|
tests/cases/compiler/indexSignatureWithoutTypeAnnotation1.ts(2,3): error TS1021: An index signature must have a type annotation.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/indexSignatureWithoutTypeAnnotation1.ts (1 errors) ====
|
||||||
|
class C {
|
||||||
|
[a: number];
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
!!! error TS1021: An index signature must have a type annotation.
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
tests/cases/compiler/modifierOnParameter1.ts(2,16): error TS1090: 'declare' modifier cannot appear on a parameter.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/modifierOnParameter1.ts (1 errors) ====
|
||||||
|
class C {
|
||||||
|
constructor(declare p) { }
|
||||||
|
~~~~~~~
|
||||||
|
!!! error TS1090: 'declare' modifier cannot appear on a parameter.
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
tests/cases/compiler/throwWithoutNewLine1.ts(1,6): error TS1109: Expression expected.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/throwWithoutNewLine1.ts (1 errors) ====
|
||||||
|
throw
|
||||||
|
|
||||||
|
!!! error TS1109: Expression expected.
|
|
@ -0,0 +1,10 @@
|
||||||
|
//// [typeParameterListWithTrailingComma1.ts]
|
||||||
|
class C<T,> {
|
||||||
|
}
|
||||||
|
|
||||||
|
//// [typeParameterListWithTrailingComma1.js]
|
||||||
|
var C = (function () {
|
||||||
|
function C() {
|
||||||
|
}
|
||||||
|
return C;
|
||||||
|
})();
|
|
@ -0,0 +1,5 @@
|
||||||
|
=== tests/cases/compiler/typeParameterListWithTrailingComma1.ts ===
|
||||||
|
class C<T,> {
|
||||||
|
>C : C<T>
|
||||||
|
>T : T
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
tests/cases/compiler/variableDeclarationInStrictMode1.ts(2,5): error TS1100: Invalid use of 'eval' in strict mode.
|
||||||
|
lib.d.ts(29,18): error TS2300: Duplicate identifier 'eval'.
|
||||||
|
tests/cases/compiler/variableDeclarationInStrictMode1.ts(2,5): error TS2300: Duplicate identifier 'eval'.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/variableDeclarationInStrictMode1.ts (2 errors) ====
|
||||||
|
"use strict";
|
||||||
|
var eval;
|
||||||
|
~~~~
|
||||||
|
!!! error TS1100: Invalid use of 'eval' in strict mode.
|
||||||
|
~~~~
|
||||||
|
!!! error TS2300: Duplicate identifier 'eval'.
|
9
tests/baselines/reference/yieldExpression1.errors.txt
Normal file
9
tests/baselines/reference/yieldExpression1.errors.txt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
tests/cases/compiler/yieldExpression1.ts(1,9): error TS9001: 'generators' are not currently supported.
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/compiler/yieldExpression1.ts (1 errors) ====
|
||||||
|
function* foo() {
|
||||||
|
~
|
||||||
|
!!! error TS9001: 'generators' are not currently supported.
|
||||||
|
yield
|
||||||
|
}
|
2
tests/cases/compiler/accessorWithoutBody1.ts
Normal file
2
tests/cases/compiler/accessorWithoutBody1.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
// @target: ES5
|
||||||
|
var v = { get foo() }
|
2
tests/cases/compiler/accessorWithoutBody2.ts
Normal file
2
tests/cases/compiler/accessorWithoutBody2.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
// @target: ES5
|
||||||
|
var v = { set foo(a) }
|
|
@ -0,0 +1 @@
|
||||||
|
Foo<a,,b>();
|
1
tests/cases/compiler/declareModifierOnImport1.ts
Normal file
1
tests/cases/compiler/declareModifierOnImport1.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
declare import a = b;
|
3
tests/cases/compiler/indexSignatureWithInitializer1.ts
Normal file
3
tests/cases/compiler/indexSignatureWithInitializer1.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class C {
|
||||||
|
[a: number = 1]: number;
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
class C {
|
||||||
|
[a: number];
|
||||||
|
}
|
3
tests/cases/compiler/modifierOnParameter1.ts
Normal file
3
tests/cases/compiler/modifierOnParameter1.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class C {
|
||||||
|
constructor(declare p) { }
|
||||||
|
}
|
1
tests/cases/compiler/throwWithoutNewLine1.ts
Normal file
1
tests/cases/compiler/throwWithoutNewLine1.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
throw
|
|
@ -0,0 +1,2 @@
|
||||||
|
class C<T,> {
|
||||||
|
}
|
2
tests/cases/compiler/variableDeclarationInStrictMode1.ts
Normal file
2
tests/cases/compiler/variableDeclarationInStrictMode1.ts
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
var eval;
|
3
tests/cases/compiler/yieldExpression1.ts
Normal file
3
tests/cases/compiler/yieldExpression1.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function* foo() {
|
||||||
|
yield
|
||||||
|
}
|
Loading…
Reference in a new issue