Open andry-tino opened 7 years ago
Discovered by newly introduced StringRendering tests. TestSuite: Rosetta\test\renderers\ScriptSharp.Definition.ASTWalker.Renderings.Tests\TestSuite.cs, test: TestClassesWithScriptNamespace.
Rosetta\test\renderers\ScriptSharp.Definition.ASTWalker.Renderings.Tests\TestSuite.cs
TestClassesWithScriptNamespace
Classes and enums are emitted:
Output for classes
Summary ------- ScriptNamespace.SingleClass.d.ts -------------------------------- Found 1 difference(s). LEFT ==== declare class Class1 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; method3(param1 : number, param2 : string, param3 : boolean) : void; method4(param1 : number, param2 : string, param3 : boolean, param4 : number) : void; } RIGHT ==== ScriptNamespace.SingleNamespacedClass.d.ts ------------------------------------------ Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export class Class1 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; method3(param1 : number, param2 : string, param3 : boolean) : void; method4(param1 : number, param2 : string, param3 : boolean, param4 : number) : void; } } RIGHT ==== ScriptNamespace.TwoClasses.d.ts ------------------------------- Found 1 difference(s). LEFT ==== declare class Class1 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } declare class Class2 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } RIGHT ==== ScriptNamespace.TwoNamespacedClasses.d.ts ----------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export class Class1 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } export class Class2 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } } RIGHT ==== ScriptNamespace.TwoMixedClasses.d.ts ------------------------------------ Found 1 difference(s). LEFT ==== declare class Class1 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } declare class Class2 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } RIGHT ==== ScriptNamespace.TwoMixedNamespacedClasses.d.ts ---------------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export class Class1 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } export class Class2 { method1(param1 : number) : void; method2(param1 : number, param2 : string) : void; } } RIGHT ====
Output for enums
Summary ------- ScriptNamespace.SingleEnum.d.ts ------------------------------- Found 1 difference(s). LEFT ==== declare enum Enum1 { Value1 } RIGHT ==== ScriptNamespace.SingleNamespacedEnum.d.ts ----------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export enum Enum1 { Value1 } } RIGHT ==== ScriptNamespace.TwoEnums.d.ts ----------------------------- Found 1 difference(s). LEFT ==== declare enum Enum1 { Value1 } declare enum Enum2 { Value1 } RIGHT ==== ScriptNamespace.TwoNamespacedEnums.d.ts --------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export enum Enum1 { Value1 } export enum Enum2 { Value1 } } RIGHT ==== ScriptNamespace.TwoMixedEnums.d.ts ---------------------------------- Found 1 difference(s). LEFT ==== declare enum Enum1 { Value1 } declare enum Enum2 { Value1 } RIGHT ==== ScriptNamespace.TwoMixedNamespacedEnums.d.ts -------------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export enum Enum1 { Value1 } export enum Enum2 { Value1 } } RIGHT ====
Output for interfaces
Summary ------- ScriptNamespace.SingleInterface.d.ts ------------------------------------ Found 1 difference(s). LEFT ==== declare interface IInterface1 { } RIGHT ==== ScriptNamespace.SingleNamespacedInterface.d.ts ---------------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export interface IInterface1 { } } RIGHT ==== ScriptNamespace.TwoInterfaces.d.ts ---------------------------------- Found 1 difference(s). LEFT ==== declare interface IInterface1 { } declare interface IInterface2 { } RIGHT ==== ScriptNamespace.TwoNamespacedInterfaces.d.ts -------------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export interface IInterface1 { } export interface IInterface2 { } } RIGHT ==== ScriptNamespace.TwoMixedInterfaces.d.ts --------------------------------------- Found 1 difference(s). LEFT ==== declare interface IInterface1 { } declare interface IInterface2 { } RIGHT ==== ScriptNamespace.TwoMixedNamespacedInterfaces.d.ts ------------------------------------------------- Found 1 difference(s). LEFT ==== declare module MyOriginalNamespace { export interface IInterface1 { } export interface IInterface2 { } } RIGHT ====
Discovered by newly introduced StringRendering tests. TestSuite:
Rosetta\test\renderers\ScriptSharp.Definition.ASTWalker.Renderings.Tests\TestSuite.cs
, test:TestClassesWithScriptNamespace
.What
Classes and enums are emitted:
Output for classes
Output for enums
Output for interfaces