test(shebang) error case

This commit is contained in:
Basarat Syed 2015-08-03 11:20:43 +10:00
parent 5fcf3d7c90
commit 9754ec10e2
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,20 @@
tests/cases/compiler/shebangError.ts(2,1): error TS1127: Invalid character.
tests/cases/compiler/shebangError.ts(2,2): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/compiler/shebangError.ts(2,12): error TS2304: Cannot find name 'env'.
tests/cases/compiler/shebangError.ts(2,16): error TS1005: ';' expected.
tests/cases/compiler/shebangError.ts(2,16): error TS2304: Cannot find name 'node'.
==== tests/cases/compiler/shebangError.ts (5 errors) ====
var foo = 'Shebang is only allowed on the first line';
#!/usr/bin/env node
!!! error TS1127: Invalid character.
~~~~~~~~~
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
~~~
!!! error TS2304: Cannot find name 'env'.
~~~~
!!! error TS1005: ';' expected.
~~~~
!!! error TS2304: Cannot find name 'node'.

View file

@ -0,0 +1,8 @@
//// [shebangError.ts]
var foo = 'Shebang is only allowed on the first line';
#!/usr/bin/env node
//// [shebangError.js]
var foo = 'Shebang is only allowed on the first line';
!/usr/bin / env;
node;

View file

@ -0,0 +1,2 @@
var foo = 'Shebang is only allowed on the first line';
#!/usr/bin/env node