From 5e716345a8863240b87456dd836970ad65a03449 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 12 Jun 2026 16:06:41 +0100 Subject: Add Java static field access --- .../hobgoblin/compiler/output/lang/java/JavaWriterTests.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/test/java') 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 96166b0..426b1c1 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 @@ -625,6 +625,18 @@ public class JavaWriterTests { assertThat(string, equalTo("\"hello\"")); } + @Test + public void staticFieldAccess() throws IOException { + var java = new JavaStaticFieldAccess( + JavaTypeRef.topLevel(List.of("one"), "Two"), + "three" + ); + + var string = write(writer -> writer.writeExpression(java)); + + assertThat(string, equalTo("one.Two.three")); + } + @Test public void newExpression() throws IOException { var java = new JavaNewExpression( -- cgit v1.2.3