diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-03-21 12:48:26 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-03-21 12:48:26 +0000 |
| commit | 5285c95b7d731d0cdf16a85aeedee28839feb9fc (patch) | |
| tree | 3bfc2a042ee015e5cf2df99162eae4e699b4f122 /src/test/java/org | |
| parent | f0e1c8c32732ea37e508fae3ff5d5cf085042733 (diff) | |
Serialize Patio mutable data element definition
Diffstat (limited to 'src/test/java/org')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/protobuf/PatioToProtobufTests.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/patio/protobuf/PatioToProtobufTests.java b/src/test/java/org/shedlang/compiler/patio/protobuf/PatioToProtobufTests.java index 6aac1e0e..f993fb68 100644 --- a/src/test/java/org/shedlang/compiler/patio/protobuf/PatioToProtobufTests.java +++ b/src/test/java/org/shedlang/compiler/patio/protobuf/PatioToProtobufTests.java @@ -49,6 +49,22 @@ public class PatioToProtobufTests { assertThat(deserializedElement, equalTo(element)); } + @Test + public void canSerializeDataElementMutableDefinition() { + var element = Patio.dataElementMutableDefinition( + "x", + PatioVisibility.PRIVATE, + PatioDataValues.int_(42) + ); + + var deserializedElement = PatioToProtobuf.deserializeCompilationUnitElement( + PatioToProtobuf.serializeCompilationUnitElement(element, Sources.NULL), + Sources.NULL + ); + + assertThat(deserializedElement, equalTo(element)); + } + // == Data ptr values == @Test |
