Debian Codegraph @

debian/missing-sources/displaydoc/tests/num_in_field.rs

raw
1 /// {foo1} {foo2}
2 #[derive(displaydoc::Display)]
3 pub struct Test {
4 foo1: String,
5 foo2: String,
6 }
7
8 fn assert_display<T: std::fmt::Display>(input: T, expected: &'static str) {
9 let out = format!("{}", input);
10 assert_eq!(expected, out);
11 }
12
13 #[test]
14 fn does_it_print() {
15 assert_display(
16 Test {
17 foo1: "hi".into(),
18 foo2: "hello".into(),
19 },
20 "hi hello",
21 );
22 }