diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-18 11:08:35 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-18 11:08:35 +0100 |
| commit | b801471a3555e81f59e60d34707cb0fd9b0864d8 (patch) | |
| tree | ab8f19016ccc1c47ae6e04b95c2eec295e254391 /examples/10-transient-0/output/rust/src/lib.rs | |
| parent | 28fee7435236bd1382a9e7281c8875564c607686 (diff) | |
Support String values in rust-transient-0
Diffstat (limited to 'examples/10-transient-0/output/rust/src/lib.rs')
| -rw-r--r-- | examples/10-transient-0/output/rust/src/lib.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/10-transient-0/output/rust/src/lib.rs b/examples/10-transient-0/output/rust/src/lib.rs index 75a7b47..6ecb19e 100644 --- a/examples/10-transient-0/output/rust/src/lib.rs +++ b/examples/10-transient-0/output/rust/src/lib.rs @@ -4,7 +4,7 @@ pub mod transient_0; #[cfg(test)] mod test { use std::io::Cursor; - use super::data::{InnerStruct, OuterStruct, StructWithBool, StructWithInt32, StructWithInt64}; + use super::data::{InnerStruct, OuterStruct, StructWithBool, StructWithInt32, StructWithInt64, StructWithString}; #[test] fn struct_with_bool() { @@ -40,6 +40,17 @@ mod test { } #[test] + fn struct_with_string() { + let value = StructWithString { a: "abc".to_string(), b: "def".to_string() }; + + assert_round_trip_encoding( + value, + super::data::transient_0::encode_struct_with_string, + super::data::transient_0::decode_struct_with_string, + ); + } + + #[test] fn nested_struct() { let value = OuterStruct { inner: InnerStruct { a: 10, b: 25 }, c: 42 }; |
