Skip to content

Commit 5363c9f

Browse files
test enums in different module/namespace combinations
1 parent b641fd2 commit 5363c9f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

typescript-generator-core/src/test/java/cz/habarta/typescript/generator/ModulesAndNamespacesTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,19 @@ private static void file(String prefix, String module, String namespace, TypeScr
3838
if (outputFileType == TypeScriptFileType.implementationFile) {
3939
settings.extensions.add(new TestFunctionExtention());
4040
}
41-
new TypeScriptGenerator(settings).generateTypeScript(Input.from(Data.class), Output.to(output));
41+
new TypeScriptGenerator(settings).generateTypeScript(Input.from(Data.class, Direction.class), Output.to(output));
4242
}
4343

4444
private static class Data {
4545
}
4646

47+
enum Direction {
48+
North,
49+
East,
50+
South,
51+
West
52+
}
53+
4754
private static class TestFunctionExtention extends EmitterExtension {
4855

4956
@Override

typescript-generator-core/src/test/ts/module-usage.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,44 @@
22
// declaration files
33

44
var a1: Test1Data;
5+
var e1: Test1Direction;
56

67
var a2: NS2.Test2Data;
8+
var e2: NS2.Test2Direction;
79

810
import * as mod3a from "mod3a";
911
var a3a: mod3a.Test3aData;
12+
var e3a: mod3a.Test3aDirection;
1013

1114
import * as mod3b from "../../../target/test-ts-modules/test-mn3b";
1215
var a3b: mod3b.Test3bData;
16+
var e3b: mod3b.Test3bDirection;
1317

1418
import * as mod4a from "mod4a";
1519
var a4a: mod4a.NS4a.Test4aData;
20+
var e4a: mod4a.NS4a.Test4aDirection;
1621

1722
import * as mod4b from "../../../target/test-ts-modules/test-mn4b";
1823
var a4b: mod4b.NS4b.Test4bData;
24+
var e4b: mod4b.NS4b.Test4bDirection;
1925

2026

2127
// implementation files
2228

2329
var a5: Test5Data;
30+
var e5: Test5Direction;
2431
test();
2532

2633
var a6: NS6.Test6Data;
34+
var e6: NS6.Test6Direction;
2735
NS6.test();
2836

2937
import * as mod7 from "../../../target/test-ts-modules/test-mn7";
3038
var a7: mod7.Test7Data;
39+
var e7: mod7.Test7Direction;
3140
mod7.test();
3241

3342
import * as mod8 from "../../../target/test-ts-modules/test-mn8";
3443
var a8: mod8.NS8.Test8Data;
44+
var e8: mod8.NS8.Test8Direction;
3545
mod8.NS8.test();

0 commit comments

Comments
 (0)