Updated tests

This commit is contained in:
Arthur Ozga
2015-06-02 15:22:52 -07:00
parent c629c3fbee
commit e4bc29e9a0
4 changed files with 119 additions and 7 deletions

View File

@@ -0,0 +1,33 @@
// @declaration: true
// @Filename: file1.ts
interface I { }
class C1 { }
class C2 { }
function f() { }
var v = 3;
class Foo {
static x: number;
}
module N {
export module F {
var t;
}
}
// @Filename: file2.ts
class I { } // error -- cannot merge interface with non-ambient class
interface C1 { } // error -- cannot merge interface with non-ambient class
function C2() { } // error -- cannot merge function with non-ambient class
class f { } // error -- cannot merge function with non-ambient class
var v = 3;
module Foo {
export var x: number; // error for redeclaring var in a different parent
}
declare module N {
export function F(); // no error because function is ambient
}

View File

@@ -0,0 +1,25 @@
interface C { }
declare class C { }
interface C { }
interface C { }
declare module M {
interface C1 { }
class C1 { }
interface C1 { }
interface C1 { }
export class C2 { }
}
declare module M {
export interface C2 { }
}

View File

@@ -1,3 +1,6 @@
// @Filename: file1.ts
declare class C1 {}
declare class C1 {}
@@ -6,4 +9,12 @@ declare class C2 {}
interface C2 {}
declare class C2 {}
declare class C2 {}
// @Filename: file2.ts
declare class C3 { }
// @Filename: file3.ts
declare class C3 { }

View File

@@ -1,11 +1,54 @@
declare class C1 {}
// @declaration: true
interface C1 {}
// @Filename: file1.ts
interface C2 {}
declare class C1 { }
declare class C2 {}
interface C1 { }
interface C2 {}
interface C2 { }
interface C2 {}
declare class C2 { }
class C3 { } // error -- cannot merge non-ambient class and interface
interface C3 { } // error -- cannot merge non-ambient class and interface
interface C4 { } // error -- cannot merge non-ambient class and interface
class C4 { } // error -- cannot merge non-ambient class and interface
interface C5 {
x1: number;
}
declare class C5 {
x2: number;
}
interface C5 {
x3: number;
}
interface C5 {
x4: number;
}
// checks if properties actually were merged
var c5 : C5;
c5.x1;
c5.x2;
c5.x3;
c5.x4;
// @Filename: file2.ts
declare class C6 { }
interface C7 { }
// @Filename: file3.ts
interface C6 { }
declare class C7 { }