From 7842b77da4767ea173a0d77b3429aeeef4657ccb Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 5 Jul 2026 13:06:19 +0100 Subject: Support bools in Java transient-0 --- .../test/java/org/zwobble/example/Transient0Tests.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'examples/10-transient-0/output/java-junit/src/test/java') diff --git a/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java b/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java index 09a23a3..ff5ca5b 100644 --- a/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java +++ b/examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java @@ -6,10 +6,25 @@ import java.io.IOException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.zwobble.example.types.data.HobgoblinTransient0Data; +import org.zwobble.example.types.data.StructWithBool; import org.zwobble.example.types.data.StructWithInt32; import org.zwobble.example.types.data.StructWithInt64; public class Transient0Tests { + @Test + public void structWithBool() throws IOException { + var value = new StructWithBool(true, false); + + var outputStream = new ByteArrayOutputStream(); + HobgoblinTransient0Data.encodeStructWithBool(value, outputStream); + var bytes = outputStream.toByteArray(); + + var inputStream = new ByteArrayInputStream(bytes); + var decodedValue = HobgoblinTransient0Data.decodeStructWithBool(inputStream); + + Assertions.assertEquals(value, decodedValue); + } + @Test public void structWithInt32() throws IOException { var value = new StructWithInt32(10, 25); -- cgit v1.2.3