Update testcase only preserve pinned comment at the top of the file

This commit is contained in:
Yui T 2015-08-25 13:47:45 -07:00
parent e36285c82c
commit 40cbd33e65
36 changed files with 281 additions and 80 deletions

View File

@ -1,7 +1,12 @@
//// [tests/cases/compiler/commentOnAmbientClass1.ts] ////
//// [a.ts]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare class C {
}
@ -15,6 +20,9 @@ declare class E extends C {
}
//// [a.js]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
//// [b.js]
///<reference path="a.ts"/>

View File

@ -5,13 +5,18 @@ declare class E extends C {
>C : Symbol(C, Decl(a.ts, 0, 0))
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare class C {
>C : Symbol(C, Decl(a.ts, 0, 0))
}
// Don't keep this comment.
declare class D {
>D : Symbol(D, Decl(a.ts, 2, 1))
>D : Symbol(D, Decl(a.ts, 7, 1))
}

View File

@ -5,7 +5,12 @@ declare class E extends C {
>C : C
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare class C {
>C : C
}

View File

@ -1,7 +1,12 @@
//// [tests/cases/compiler/commentOnAmbientEnum.ts] ////
//// [a.ts]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare enum C {
a,
b,
@ -18,6 +23,9 @@ declare enum E {
}
//// [a.js]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
//// [b.js]
///<reference path="a.ts"/>

View File

@ -4,22 +4,27 @@ declare enum E {
>E : Symbol(E, Decl(b.ts, 0, 0))
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare enum C {
>C : Symbol(C, Decl(a.ts, 0, 0))
a,
>a : Symbol(C.a, Decl(a.ts, 1, 16))
>a : Symbol(C.a, Decl(a.ts, 6, 16))
b,
>b : Symbol(C.b, Decl(a.ts, 2, 6))
>b : Symbol(C.b, Decl(a.ts, 7, 6))
c
>c : Symbol(C.c, Decl(a.ts, 3, 6))
>c : Symbol(C.c, Decl(a.ts, 8, 6))
}
// Don't keep this comment.
declare enum D {
>D : Symbol(D, Decl(a.ts, 5, 1))
>D : Symbol(D, Decl(a.ts, 10, 1))
}

View File

@ -4,7 +4,12 @@ declare enum E {
>E : E
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare enum C {
>C : C

View File

@ -1,7 +1,12 @@
//// [tests/cases/compiler/commentOnAmbientModule.ts] ////
//// [a.ts]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare module C {
function foo();
}
@ -20,6 +25,9 @@ declare module E {
}
//// [a.js]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
//// [b.js]
///<reference path="a.ts"/>

View File

@ -5,28 +5,33 @@ declare module E {
class foobar extends D.bar {
>foobar : Symbol(foobar, Decl(b.ts, 1, 18))
>D.bar : Symbol(D.bar, Decl(a.ts, 6, 18))
>D : Symbol(D, Decl(a.ts, 3, 1))
>bar : Symbol(D.bar, Decl(a.ts, 6, 18))
>D.bar : Symbol(D.bar, Decl(a.ts, 11, 18))
>D : Symbol(D, Decl(a.ts, 8, 1))
>bar : Symbol(D.bar, Decl(a.ts, 11, 18))
foo();
>foo : Symbol(foo, Decl(b.ts, 2, 32))
}
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare module C {
>C : Symbol(C, Decl(a.ts, 0, 0))
function foo();
>foo : Symbol(foo, Decl(a.ts, 1, 18))
>foo : Symbol(foo, Decl(a.ts, 6, 18))
}
// Don't keep this comment.
declare module D {
>D : Symbol(D, Decl(a.ts, 3, 1))
>D : Symbol(D, Decl(a.ts, 8, 1))
class bar { }
>bar : Symbol(bar, Decl(a.ts, 6, 18))
>bar : Symbol(bar, Decl(a.ts, 11, 18))
}

View File

@ -14,7 +14,12 @@ declare module E {
}
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare module C {
>C : typeof C

View File

@ -1,9 +1,17 @@
//// [commentOnAmbientVariable1.ts]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare var v: number;
// Don't keep this comment.
declare var y: number;
//// [commentOnAmbientVariable1.js]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/

View File

@ -1,9 +1,14 @@
=== tests/cases/compiler/commentOnAmbientVariable1.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare var v: number;
>v : Symbol(v, Decl(commentOnAmbientVariable1.ts, 1, 11))
>v : Symbol(v, Decl(commentOnAmbientVariable1.ts, 6, 11))
// Don't keep this comment.
declare var y: number;
>y : Symbol(y, Decl(commentOnAmbientVariable1.ts, 4, 11))
>y : Symbol(y, Decl(commentOnAmbientVariable1.ts, 9, 11))

View File

@ -1,5 +1,10 @@
=== tests/cases/compiler/commentOnAmbientVariable1.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare var v: number;
>v : number

View File

@ -1,7 +1,12 @@
//// [tests/cases/compiler/commentOnAmbientfunction.ts] ////
//// [a.ts]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare function foo();
// Don't keep this comment.
@ -12,6 +17,9 @@ declare function bar();
declare function foobar(a: typeof foo): typeof bar;
//// [a.js]
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
//// [b.js]
///<reference path="a.ts"/>

View File

@ -4,14 +4,19 @@ declare function foobar(a: typeof foo): typeof bar;
>foobar : Symbol(foobar, Decl(b.ts, 0, 0))
>a : Symbol(a, Decl(b.ts, 1, 24))
>foo : Symbol(foo, Decl(a.ts, 0, 0))
>bar : Symbol(bar, Decl(a.ts, 1, 23))
>bar : Symbol(bar, Decl(a.ts, 6, 23))
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare function foo();
>foo : Symbol(foo, Decl(a.ts, 0, 0))
// Don't keep this comment.
declare function bar();
>bar : Symbol(bar, Decl(a.ts, 1, 23))
>bar : Symbol(bar, Decl(a.ts, 6, 23))

View File

@ -7,7 +7,12 @@ declare function foobar(a: typeof foo): typeof bar;
>bar : () => any
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare function foo();
>foo : () => any

View File

@ -1,7 +1,12 @@
//// [tests/cases/compiler/commentOnElidedModule1.ts] ////
//// [a.ts]
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
module ElidedModule {
}
@ -15,6 +20,9 @@ module ElidedModule3 {
}
//// [a.js]
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
//// [b.js]
///<reference path="a.ts"/>

View File

@ -4,13 +4,18 @@ module ElidedModule3 {
>ElidedModule3 : Symbol(ElidedModule3, Decl(b.ts, 0, 0))
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
module ElidedModule {
>ElidedModule : Symbol(ElidedModule, Decl(a.ts, 0, 0))
}
// Don't keep this comment.
module ElidedModule2 {
>ElidedModule2 : Symbol(ElidedModule2, Decl(a.ts, 2, 1))
>ElidedModule2 : Symbol(ElidedModule2, Decl(a.ts, 7, 1))
}

View File

@ -4,7 +4,12 @@ module ElidedModule3 {
>ElidedModule3 : any
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
module ElidedModule {
>ElidedModule : any
}

View File

@ -1,7 +1,12 @@
//// [tests/cases/compiler/commentOnInterface1.ts] ////
//// [a.ts]
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
interface I {
}
@ -15,6 +20,9 @@ interface I3 {
}
//// [a.js]
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
//// [b.js]
///<reference path='a.ts'/>

View File

@ -4,13 +4,18 @@ interface I3 {
>I3 : Symbol(I3, Decl(b.ts, 0, 0))
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
interface I {
>I : Symbol(I, Decl(a.ts, 0, 0))
}
// Don't keep this comment.
interface I2 {
>I2 : Symbol(I2, Decl(a.ts, 2, 1))
>I2 : Symbol(I2, Decl(a.ts, 7, 1))
}

View File

@ -4,7 +4,12 @@ interface I3 {
>I3 : I3
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
interface I {
>I : I
}

View File

@ -1,7 +1,12 @@
//// [tests/cases/compiler/commentOnSignature1.ts] ////
//// [a.ts]
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
function foo(n: number): void;
// Don't keep this comment.
function foo(s: string): void;
@ -33,14 +38,15 @@ function foo2(a: any): void {
}
//// [a.js]
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
function foo(a) {
}
var c = (function () {
/*! keep this pinned comment */
function c(a) {
}
/*! keep this pinned comment */
c.prototype.foo = function (a) {
};
return c;

View File

@ -14,49 +14,54 @@ function foo2(a: any): void {
>a : Symbol(a, Decl(b.ts, 4, 14))
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
function foo(n: number): void;
>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30))
>n : Symbol(n, Decl(a.ts, 1, 13))
>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 6, 30), Decl(a.ts, 8, 30))
>n : Symbol(n, Decl(a.ts, 6, 13))
// Don't keep this comment.
function foo(s: string): void;
>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30))
>s : Symbol(s, Decl(a.ts, 3, 13))
>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 6, 30), Decl(a.ts, 8, 30))
>s : Symbol(s, Decl(a.ts, 8, 13))
function foo(a: any): void {
>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30))
>a : Symbol(a, Decl(a.ts, 4, 13))
>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 6, 30), Decl(a.ts, 8, 30))
>a : Symbol(a, Decl(a.ts, 9, 13))
}
class c {
>c : Symbol(c, Decl(a.ts, 5, 1))
>c : Symbol(c, Decl(a.ts, 10, 1))
// dont keep this comment
constructor(a: string);
>a : Symbol(a, Decl(a.ts, 9, 16))
>a : Symbol(a, Decl(a.ts, 14, 16))
/*! keep this pinned comment */
constructor(a: number);
>a : Symbol(a, Decl(a.ts, 11, 16))
>a : Symbol(a, Decl(a.ts, 16, 16))
constructor(a: any) {
>a : Symbol(a, Decl(a.ts, 12, 16))
>a : Symbol(a, Decl(a.ts, 17, 16))
}
// dont keep this comment
foo(a: string);
>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19))
>a : Symbol(a, Decl(a.ts, 16, 8))
>foo : Symbol(foo, Decl(a.ts, 18, 5), Decl(a.ts, 21, 19), Decl(a.ts, 23, 19))
>a : Symbol(a, Decl(a.ts, 21, 8))
/*! keep this pinned comment */
foo(a: number);
>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19))
>a : Symbol(a, Decl(a.ts, 18, 8))
>foo : Symbol(foo, Decl(a.ts, 18, 5), Decl(a.ts, 21, 19), Decl(a.ts, 23, 19))
>a : Symbol(a, Decl(a.ts, 23, 8))
foo(a: any) {
>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19))
>a : Symbol(a, Decl(a.ts, 19, 8))
>foo : Symbol(foo, Decl(a.ts, 18, 5), Decl(a.ts, 21, 19), Decl(a.ts, 23, 19))
>a : Symbol(a, Decl(a.ts, 24, 8))
}
}

View File

@ -14,7 +14,12 @@ function foo2(a: any): void {
>a : any
}
=== tests/cases/compiler/a.ts ===
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
function foo(n: number): void;
>foo : { (n: number): void; (s: string): void; }
>n : number

View File

@ -1,12 +1,19 @@
//// [pinnedComments1.ts]
/*!=========
Keep this pinned comment
=========
*/
/* unpinned comment */
/*! pinned comment */
/*! pinned comment that need to be removed */
class C {
}
//// [pinnedComments1.js]
/*! pinned comment */
/*!=========
Keep this pinned comment
=========
*/
var C = (function () {
function C() {
}

View File

@ -1,7 +1,11 @@
=== tests/cases/compiler/pinnedComments1.ts ===
/*!=========
Keep this pinned comment
=========
*/
/* unpinned comment */
/*! pinned comment */
/*! pinned comment that need to be removed */
class C {
>C : Symbol(C, Decl(pinnedComments1.ts, 0, 0))
}

View File

@ -1,7 +1,11 @@
=== tests/cases/compiler/pinnedComments1.ts ===
/*!=========
Keep this pinned comment
=========
*/
/* unpinned comment */
/*! pinned comment */
/*! pinned comment that need to be removed */
class C {
>C : C
}

View File

@ -1,5 +1,10 @@
//@filename: a.ts
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare class C {
}

View File

@ -1,5 +1,10 @@
//@filename: a.ts
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare enum C {
a,
b,

View File

@ -1,5 +1,10 @@
//@filename: a.ts
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare module C {
function foo();
}

View File

@ -1,4 +1,9 @@
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare var v: number;
// Don't keep this comment.

View File

@ -1,5 +1,10 @@
//@filename: a.ts
/*! Keep this pinned comment */
/*!=========
Keep this pinned comment
=========
*/
/*! Don't keep this pinned comment */
declare function foo();
// Don't keep this comment.

View File

@ -1,5 +1,10 @@
//@filename: a.ts
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
module ElidedModule {
}

View File

@ -1,5 +1,10 @@
//@filename: a.ts
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
interface I {
}

View File

@ -1,5 +1,10 @@
// @filename: a.ts
/*! Keep this pinned comment */
/*!=================
Keep this pinned
=================
*/
/*! Don't keep this pinned comment */
function foo(n: number): void;
// Don't keep this comment.
function foo(s: string): void;

View File

@ -1,6 +1,10 @@
// @comments: false
/*!=========
Keep this pinned comment
=========
*/
/* unpinned comment */
/*! pinned comment */
/*! pinned comment that need to be removed */
class C {
}