summaryrefslogtreecommitdiff
path: root/tests/num_in_field.rs
blob: ab90f0d76a9693c7841c9de5f31bc6efcb0a84d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// {foo1} {foo2}
#[derive(displaydoc::Display)]
pub struct Test {
    foo1: String,
    foo2: String,
}

fn assert_display<T: std::fmt::Display>(input: T, expected: &'static str) {
    let out = format!("{}", input);
    assert_eq!(expected, out);
}

#[test]
fn does_it_print() {
    assert_display(
        Test {
            foo1: "hi".into(),
            foo2: "hello".into(),
        },
        "hi hello",
    );
}