diff options
Diffstat (limited to 'src/test/java/org/zwobble')
| -rw-r--r-- | src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java index c349ec1..fd282f9 100644 --- a/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java +++ b/src/test/java/org/zwobble/hobgoblin/compiler/output/lang/java/JavaWriterTests.java @@ -309,6 +309,23 @@ public class JavaWriterTests { } @Test + public void emptyMethodWithoutBody() throws IOException { + var java = new JavaMethodDeclaration( + "a", + JavaMethodKind.INSTANCE, + JavaTypeRef.VOID, + List.of(), + Optional.empty() + ); + + var string = write(writer -> writer.writeMethodDeclaration(java)); + + assertThat(string, equalTo(""" + public void a();""" + )); + } + + @Test public void emptyInstanceMethod() throws IOException { var java = new JavaMethodDeclaration( "a", |
