From b801471a3555e81f59e60d34707cb0fd9b0864d8 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 18 Jul 2026 11:08:35 +0100 Subject: Support String values in rust-transient-0 --- examples/10-transient-0/output/rust/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'examples/10-transient-0/output/rust/src/lib.rs') 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() { @@ -39,6 +39,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 }; -- cgit v1.2.3