diff options
Diffstat (limited to 'third_party/rust/ron/tests/borrowed_str.rs')
-rw-r--r-- | third_party/rust/ron/tests/borrowed_str.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/third_party/rust/ron/tests/borrowed_str.rs b/third_party/rust/ron/tests/borrowed_str.rs new file mode 100644 index 0000000000..f01eeb141f --- /dev/null +++ b/third_party/rust/ron/tests/borrowed_str.rs @@ -0,0 +1,16 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +struct Borrowed<'a> { + value: &'a str, +} + +const BORROWED: &str = "Borrowed(value: \"test\")"; + +#[test] +fn borrowed_str() { + assert_eq!( + ron::de::from_str(BORROWED).ok(), + Some(Borrowed { value: "test" }) + ); +} |