Update tests file for /// and detached comments

This commit is contained in:
Yui T
2015-08-20 11:31:51 -07:00
parent 21ebc71325
commit 4b7e2b3139
41 changed files with 866 additions and 162 deletions

View File

@@ -1,8 +0,0 @@
// @comments: false
// @Filename: file0.ts
// @Fileame: file1.ts
/// <reference path="file0.ts" />
declare var OData: any;

View File

@@ -0,0 +1,33 @@
//// [doNotEmitDetachedComments.ts]
/*
multi line
comment
*/
var x = 10;
// Single Line comment
function foo() { }
/*
multi-line comment
*/
//========================
function bar() { }
//========================
//// [doNotEmitDetachedComments.js]
var x = 10;
function foo() { }
function bar() { }

View File

@@ -0,0 +1,31 @@
=== tests/cases/compiler/doNotEmitDetachedComments.ts ===
/*
multi line
comment
*/
var x = 10;
>x : Symbol(x, Decl(doNotEmitDetachedComments.ts, 6, 3))
// Single Line comment
function foo() { }
>foo : Symbol(foo, Decl(doNotEmitDetachedComments.ts, 6, 11))
/*
multi-line comment
*/
//========================
function bar() { }
>bar : Symbol(bar, Decl(doNotEmitDetachedComments.ts, 10, 18))
//========================

View File

@@ -0,0 +1,32 @@
=== tests/cases/compiler/doNotEmitDetachedComments.ts ===
/*
multi line
comment
*/
var x = 10;
>x : number
>10 : number
// Single Line comment
function foo() { }
>foo : () => void
/*
multi-line comment
*/
//========================
function bar() { }
>bar : () => void
//========================

View File

@@ -0,0 +1,64 @@
//// [doNotEmitDetachedCommentsAtStartOfConstructor.ts]
class A {
constructor() {
// Single Line Comment
var x = 10;
}
}
class B {
constructor() {
/*
Multi-line comment
*/
var y = 10;
}
}
class C {
constructor() {
// Single Line Comment with more than one blank line
var x = 10;
}
}
class D {
constructor() {
/*
Multi-line comment with more than one blank line
*/
var y = 10;
}
}
//// [doNotEmitDetachedCommentsAtStartOfConstructor.js]
var A = (function () {
function A() {
var x = 10;
}
return A;
})();
var B = (function () {
function B() {
var y = 10;
}
return B;
})();
var C = (function () {
function C() {
var x = 10;
}
return C;
})();
var D = (function () {
function D() {
var y = 10;
}
return D;
})();

View File

@@ -0,0 +1,50 @@
=== tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfConstructor.ts ===
class A {
>A : Symbol(A, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 0, 0))
constructor() {
// Single Line Comment
var x = 10;
>x : Symbol(x, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 4, 11))
}
}
class B {
>B : Symbol(B, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 6, 1))
constructor() {
/*
Multi-line comment
*/
var y = 10;
>y : Symbol(y, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 14, 11))
}
}
class C {
>C : Symbol(C, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 16, 1))
constructor() {
// Single Line Comment with more than one blank line
var x = 10;
>x : Symbol(x, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 23, 11))
}
}
class D {
>D : Symbol(D, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 25, 1))
constructor() {
/*
Multi-line comment with more than one blank line
*/
var y = 10;
>y : Symbol(y, Decl(doNotEmitDetachedCommentsAtStartOfConstructor.ts, 34, 11))
}
}

View File

@@ -0,0 +1,54 @@
=== tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfConstructor.ts ===
class A {
>A : A
constructor() {
// Single Line Comment
var x = 10;
>x : number
>10 : number
}
}
class B {
>B : B
constructor() {
/*
Multi-line comment
*/
var y = 10;
>y : number
>10 : number
}
}
class C {
>C : C
constructor() {
// Single Line Comment with more than one blank line
var x = 10;
>x : number
>10 : number
}
}
class D {
>D : D
constructor() {
/*
Multi-line comment with more than one blank line
*/
var y = 10;
>y : number
>10 : number
}
}

View File

@@ -0,0 +1,48 @@
//// [doNotEmitDetachedCommentsAtStartOfFunctionBody.ts]
function foo1() {
// Single line comment
return 42;
}
function foo2() {
/*
multi line
comment
*/
return 42;
}
function foo3() {
// Single line comment with more than one blank line
return 42;
}
function foo4() {
/*
multi line comment with more than one blank line
*/
return 42;
}
//// [doNotEmitDetachedCommentsAtStartOfFunctionBody.js]
function foo1() {
return 42;
}
function foo2() {
return 42;
}
function foo3() {
return 42;
}
function foo4() {
return 42;
}

View File

@@ -0,0 +1,42 @@
=== tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfFunctionBody.ts ===
function foo1() {
>foo1 : Symbol(foo1, Decl(doNotEmitDetachedCommentsAtStartOfFunctionBody.ts, 0, 0))
// Single line comment
return 42;
}
function foo2() {
>foo2 : Symbol(foo2, Decl(doNotEmitDetachedCommentsAtStartOfFunctionBody.ts, 4, 1))
/*
multi line
comment
*/
return 42;
}
function foo3() {
>foo3 : Symbol(foo3, Decl(doNotEmitDetachedCommentsAtStartOfFunctionBody.ts, 14, 1))
// Single line comment with more than one blank line
return 42;
}
function foo4() {
>foo4 : Symbol(foo4, Decl(doNotEmitDetachedCommentsAtStartOfFunctionBody.ts, 21, 1))
/*
multi line comment with more than one blank line
*/
return 42;
}

View File

@@ -0,0 +1,46 @@
=== tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfFunctionBody.ts ===
function foo1() {
>foo1 : () => number
// Single line comment
return 42;
>42 : number
}
function foo2() {
>foo2 : () => number
/*
multi line
comment
*/
return 42;
>42 : number
}
function foo3() {
>foo3 : () => number
// Single line comment with more than one blank line
return 42;
>42 : number
}
function foo4() {
>foo4 : () => number
/*
multi line comment with more than one blank line
*/
return 42;
>42 : number
}

View File

@@ -0,0 +1,45 @@
//// [doNotEmitDetachedCommentsAtStartOfLambdaFunction.ts]
() => {
// Single line comment
return 0;
}
() => {
/*
multi-line comment
*/
return 0;
}
() => {
// Single line comment with more than one blank line
return 0;
}
() => {
/*
multi-line comment with more than one blank line
*/
return 0;
}
//// [doNotEmitDetachedCommentsAtStartOfLambdaFunction.js]
(function () {
return 0;
});
(function () {
return 0;
});
(function () {
return 0;
});
(function () {
return 0;
});

View File

@@ -0,0 +1,32 @@
=== tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfLambdaFunction.ts ===
() => {
No type information for this code. // Single line comment
No type information for this code.
No type information for this code. return 0;
No type information for this code.}
No type information for this code.
No type information for this code.() => {
No type information for this code. /*
No type information for this code. multi-line comment
No type information for this code. */
No type information for this code.
No type information for this code. return 0;
No type information for this code.}
No type information for this code.
No type information for this code.() => {
No type information for this code. // Single line comment with more than one blank line
No type information for this code.
No type information for this code.
No type information for this code. return 0;
No type information for this code.}
No type information for this code.
No type information for this code.() => {
No type information for this code. /*
No type information for this code. multi-line comment with more than one blank line
No type information for this code. */
No type information for this code.
No type information for this code.
No type information for this code. return 0;
No type information for this code.}
No type information for this code.
No type information for this code.

View File

@@ -0,0 +1,43 @@
=== tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfLambdaFunction.ts ===
() => {
>() => { // Single line comment return 0;} : () => number
// Single line comment
return 0;
>0 : number
}
() => {
>() => { /* multi-line comment */ return 0;} : () => number
/*
multi-line comment
*/
return 0;
>0 : number
}
() => {
>() => { // Single line comment with more than one blank line return 0;} : () => number
// Single line comment with more than one blank line
return 0;
>0 : number
}
() => {
>() => { /* multi-line comment with more than one blank line */ return 0;} : () => number
/*
multi-line comment with more than one blank line
*/
return 0;
>0 : number
}

View File

@@ -2,11 +2,18 @@
//// [file0.ts]
/// <reference path="file1.ts" />
class C {
/// <reference path="file1.ts" />
public foo(x: string, y: any)
public foo(x: string, y: number) { }
}
//// [file1.ts]
var x = 10;
/// <reference path="file0.ts" />
declare var OData: any;
//// [file0.js]
//// [file1.js]
var x = 10;

View File

@@ -1,10 +1,8 @@
=== tests/cases/compiler/file1.ts ===
var x = 10;
>x : Symbol(x, Decl(file1.ts, 0, 3))
/// <reference path="file0.ts" />
declare var OData: any;
>OData : Symbol(OData, Decl(file1.ts, 2, 11))
>OData : Symbol(OData, Decl(file1.ts, 3, 11))
=== tests/cases/compiler/file0.ts ===
No type information for this code.
No type information for this code.

View File

@@ -1,10 +1,9 @@
=== tests/cases/compiler/file1.ts ===
var x = 10;
>x : number
>10 : number
/// <reference path="file0.ts" />
declare var OData: any;
>OData : any
=== tests/cases/compiler/file0.ts ===
No type information for this code.
No type information for this code.

View File

@@ -3,13 +3,13 @@
//// [file0.ts]
//// [file2.ts]
//// [file1.ts]
//// [file2.ts]
/// <reference path="file0.ts" />
/// <reference path="file2.ts" />
/// <reference path="file1.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
//// [file0.js]
//// [file2.js]
//// [file1.js]
//// [file2.js]

View File

@@ -1,10 +1,10 @@
=== tests/cases/compiler/file1.ts ===
=== tests/cases/compiler/file2.ts ===
/// <reference path="file0.ts" />
No type information for this code./// <reference path="file2.ts" />
No type information for this code./// <reference path="file1.ts" />
No type information for this code./// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
No type information for this code.=== tests/cases/compiler/file0.ts ===
No type information for this code.
No type information for this code.=== tests/cases/compiler/file2.ts ===
No type information for this code.=== tests/cases/compiler/file1.ts ===
No type information for this code.

View File

@@ -1,10 +1,10 @@
=== tests/cases/compiler/file1.ts ===
=== tests/cases/compiler/file2.ts ===
/// <reference path="file0.ts" />
No type information for this code./// <reference path="file2.ts" />
No type information for this code./// <reference path="file1.ts" />
No type information for this code./// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
No type information for this code.=== tests/cases/compiler/file0.ts ===
No type information for this code.
No type information for this code.=== tests/cases/compiler/file2.ts ===
No type information for this code.=== tests/cases/compiler/file1.ts ===
No type information for this code.

View File

@@ -1,15 +0,0 @@
//// [tests/cases/compiler/doNotEmitTripleSlashCommentsInTheMiddle.ts] ////
//// [0.ts]
//// [1.ts]
/// <reference path="0.ts" />
var x = 10;
/// <reference path="0.ts" />
var y = 1000;
//// [0.js]
//// [1.js]
var x = 10;
var y = 1000;

View File

@@ -1,13 +0,0 @@
=== tests/cases/compiler/1.ts ===
/// <reference path="0.ts" />
var x = 10;
>x : Symbol(x, Decl(1.ts, 1, 3))
/// <reference path="0.ts" />
var y = 1000;
>y : Symbol(y, Decl(1.ts, 3, 3))
=== tests/cases/compiler/0.ts ===
No type information for this code.
No type information for this code.

View File

@@ -1,15 +0,0 @@
=== tests/cases/compiler/1.ts ===
/// <reference path="0.ts" />
var x = 10;
>x : number
>10 : number
/// <reference path="0.ts" />
var y = 1000;
>y : number
>1000 : number
=== tests/cases/compiler/0.ts ===
No type information for this code.
No type information for this code.

View File

@@ -1,15 +0,0 @@
//// [doNotEmitdetachedCommentAtStartOfFunctionBody.ts]
function foo() {
/*
multi line
comment
*/
return 42;
}
//// [doNotEmitdetachedCommentAtStartOfFunctionBody.js]
function foo() {
return 42;
}

View File

@@ -1,12 +0,0 @@
=== tests/cases/compiler/doNotEmitdetachedCommentAtStartOfFunctionBody.ts ===
function foo() {
>foo : Symbol(foo, Decl(doNotEmitdetachedCommentAtStartOfFunctionBody.ts, 0, 0))
/*
multi line
comment
*/
return 42;
}

View File

@@ -1,13 +0,0 @@
=== tests/cases/compiler/doNotEmitdetachedCommentAtStartOfFunctionBody.ts ===
function foo() {
>foo : () => number
/*
multi line
comment
*/
return 42;
>42 : number
}

View File

@@ -2,16 +2,45 @@
//// [file0.ts]
//// [file2.ts]
/// <reference path="file1.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var x = 10;
/// <reference path="file1.ts" />
var y = "hello";
/// <reference path="file2.ts" />
//// [file1.ts]
/// <reference path="file0.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var OData: any;
function foo() { }
/// <reference path="file0.ts" />
var z = "world";
//// [file2.ts]
/// <reference path="file1.ts" />
/// ====================================
function bar() { }
//// [file0.js]
//// [file2.js]
var x = 10;
var y = "hello";
//// [file1.js]
var OData;
function foo() { }
var z = "world";
//// [file2.js]
function bar() { }

View File

@@ -1,13 +1,40 @@
=== tests/cases/compiler/file1.ts ===
/// <reference path="file0.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var OData: any;
>OData : Symbol(OData, Decl(file1.ts, 3, 3))
=== tests/cases/compiler/file2.ts ===
/// <reference path="file1.ts" />
/// ====================================
function bar() { }
>bar : Symbol(bar, Decl(file2.ts, 0, 0))
=== tests/cases/compiler/file0.ts ===
No type information for this code.
No type information for this code.=== tests/cases/compiler/file2.ts ===
/// <reference path="file1.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var x = 10;
>x : Symbol(x, Decl(file0.ts, 4, 3))
/// <reference path="file1.ts" />
var y = "hello";
>y : Symbol(y, Decl(file0.ts, 7, 3))
/// <reference path="file2.ts" />
=== tests/cases/compiler/file1.ts ===
/// <reference path="file0.ts" />
function foo() { }
>foo : Symbol(foo, Decl(file1.ts, 0, 0))
/// <reference path="file0.ts" />
var z = "world";
>z : Symbol(z, Decl(file1.ts, 8, 3))
No type information for this code.

View File

@@ -1,13 +1,43 @@
=== tests/cases/compiler/file1.ts ===
/// <reference path="file0.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var OData: any;
>OData : any
=== tests/cases/compiler/file2.ts ===
/// <reference path="file1.ts" />
/// ====================================
function bar() { }
>bar : () => void
=== tests/cases/compiler/file0.ts ===
No type information for this code.
No type information for this code.=== tests/cases/compiler/file2.ts ===
/// <reference path="file1.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var x = 10;
>x : number
>10 : number
/// <reference path="file1.ts" />
var y = "hello";
>y : string
>"hello" : string
/// <reference path="file2.ts" />
=== tests/cases/compiler/file1.ts ===
/// <reference path="file0.ts" />
function foo() { }
>foo : () => void
/// <reference path="file0.ts" />
var z = "world";
>z : string
>"world" : string
No type information for this code.

View File

@@ -0,0 +1,16 @@
//// [emitPinnedCommentsOnTopOfFile.ts]
/*!
multi line
comment
*/
var x = 10;
//// [emitPinnedCommentsOnTopOfFile.js]
/*!
multi line
comment
*/
var x = 10;

View File

@@ -0,0 +1,10 @@
=== tests/cases/compiler/emitPinnedCommentsOnTopOfFile.ts ===
/*!
multi line
comment
*/
var x = 10;
>x : Symbol(x, Decl(emitPinnedCommentsOnTopOfFile.ts, 6, 3))

View File

@@ -0,0 +1,11 @@
=== tests/cases/compiler/emitPinnedCommentsOnTopOfFile.ts ===
/*!
multi line
comment
*/
var x = 10;
>x : number
>10 : number

View File

@@ -0,0 +1,27 @@
// @comments: false
/*
multi line
comment
*/
var x = 10;
// Single Line comment
function foo() { }
/*
multi-line comment
*/
//========================
function bar() { }
//========================

View File

@@ -0,0 +1,38 @@
// @comments: false
class A {
constructor() {
// Single Line Comment
var x = 10;
}
}
class B {
constructor() {
/*
Multi-line comment
*/
var y = 10;
}
}
class C {
constructor() {
// Single Line Comment with more than one blank line
var x = 10;
}
}
class D {
constructor() {
/*
Multi-line comment with more than one blank line
*/
var y = 10;
}
}

View File

@@ -0,0 +1,33 @@
// @comments: false
function foo1() {
// Single line comment
return 42;
}
function foo2() {
/*
multi line
comment
*/
return 42;
}
function foo3() {
// Single line comment with more than one blank line
return 42;
}
function foo4() {
/*
multi line comment with more than one blank line
*/
return 42;
}

View File

@@ -0,0 +1,30 @@
// @comments: false
() => {
// Single line comment
return 0;
}
() => {
/*
multi-line comment
*/
return 0;
}
() => {
// Single line comment with more than one blank line
return 0;
}
() => {
/*
multi-line comment with more than one blank line
*/
return 0;
}

View File

@@ -1,8 +1,15 @@
// @comments: false
// @Filename: file0.ts
/// <reference path="file1.ts" />
class C {
/// <reference path="file1.ts" />
public foo(x: string, y: any)
public foo(x: string, y: number) { }
}
// @Filename: file1.ts
var x = 10;
/// <reference path="file0.ts" />
declare var OData: any;

View File

@@ -2,9 +2,9 @@
// @Filename: file0.ts
// @Filename: file2.ts
// @Filename: file1.ts
// @Filename: file2.ts
/// <reference path="file0.ts" />
/// <reference path="file2.ts" />
/// <reference path="file1.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>

View File

@@ -1,9 +0,0 @@
// @comments: false
// @Filename: 0.ts
// @filename: 1.ts
/// <reference path="0.ts" />
var x = 10;
/// <reference path="0.ts" />
var y = 1000;

View File

@@ -1,10 +0,0 @@
// @comments: false
function foo() {
/*
multi line
comment
*/
return 42;
}

View File

@@ -1,11 +1,35 @@
// @comments: false
// @Filename: file0.ts
/// <reference path="file1.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var x = 10;
// @Filename: file2.ts
/// <reference path="file1.ts" />
var y = "hello";
/// <reference path="file2.ts" />
// @Filename: file1.ts
/// <reference path="file0.ts" />
/// <reference path="file2.ts" />
/// <amd-dependency path="/js/libs/hgn.js!app/templates/home" name="compiler"/>
var OData: any;
function foo() { }
/// <reference path="file0.ts" />
var z = "world";
// @Filename: file2.ts
/// <reference path="file1.ts" />
/// ====================================
function bar() { }

View File

@@ -0,0 +1,8 @@
// @comments: false
/*!
multi line
comment
*/
var x = 10;