diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-05 13:06:19 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-05 13:06:19 +0100 |
| commit | 7842b77da4767ea173a0d77b3429aeeef4657ccb (patch) | |
| tree | df88bdd9f2ca11205495cf0b33b93961dee81653 /examples/10-transient-0/output/java-junit/src/test/java | |
| parent | 114823dba737858fcdd6e3748f58865bf0204784 (diff) | |
Support bools in Java transient-0
Diffstat (limited to 'examples/10-transient-0/output/java-junit/src/test/java')
| -rw-r--r-- | examples/10-transient-0/output/java-junit/src/test/java/org/zwobble/example/Transient0Tests.java | 15 |
1 files changed, 15 insertions, 0 deletions
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,11 +6,26 @@ 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); |
