From 7cb7ff1af970c1e759e92e5e7bee10a13ffe8db5 Mon Sep 17 00:00:00 2001 From: Andreas Hager Date: Sat, 30 Sep 2023 08:35:00 +0200 Subject: [PATCH] #278 template names are properly normalized --- .../java/gg/jte/compiler/TemplateCompiler.java | 2 ++ .../main/java/gg/jte/compiler/module/Module.java | 12 ++++++++++++ .../java/gg/jte/TemplateEngine_ModulesTest.java | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/jte/src/main/java/gg/jte/compiler/TemplateCompiler.java b/jte/src/main/java/gg/jte/compiler/TemplateCompiler.java index a8665ba9..a8f4e1cd 100644 --- a/jte/src/main/java/gg/jte/compiler/TemplateCompiler.java +++ b/jte/src/main/java/gg/jte/compiler/TemplateCompiler.java @@ -284,6 +284,8 @@ public ClassInfo generateTemplateCall(String name, LinkedHashSetline chart (checkout)

line chart (core)"""); } + @Test + void emptyTopLevelModule_generateAll() { + DirectoryCodeResolver codeResolver = new DirectoryCodeResolver(Path.of("src/test/modules/empty-top-level-module")); + TemplateEngine templateEngine = TemplateEngine.create(codeResolver, ContentType.Html); + + List templates = templateEngine.generateAll(); + + assertThat(templates).containsExactlyInAnyOrder( + "gg/jte/generated/ondemand/apexcharts/JtelinechartGenerated.java", + "gg/jte/generated/ondemand/checkout/JtepageGenerated.java", + "gg/jte/generated/ondemand/core/JtelayoutGenerated.java", + "gg/jte/generated/ondemand/core/component/JtecssGenerated.java" + ); + } + // TODO adjust precompileAll() and generateAll() to iterate over all module files as well! }