summaryrefslogtreecommitdiffstats
path: root/third_party/rust/ron/tests/borrowed_str.rs
blob: f01eeb141fed014e2b60fbfbd2fe124fe2b1f417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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" })
    );
}