1 use super::{Toc, TocBuilder, TocEntry};
5 let mut builder = TocBuilder::new();
7 // this is purposely not using a fancy macro like below so
8 // that we're sure that this is doing the correct thing, and
9 // there's been no macro mistake.
11 ($level: expr, $name: expr) => {
12 assert_eq!(builder.push($level, $name.to_string(), "".to_string()), $name);
34 push!(6, "3.0.0.1.0.1");
44 ($(($level: expr, $name: expr, $(($sub: tt))* )),*) => {
50 name: $name.to_string(),
51 sec_number: $name.to_string(),
53 children: toc!($($sub),*)
65 ((2, "1.1", ((3, "1.1.1",))((3, "1.1.2",))))((
68 ((3, "1.2.1",))((3, "1.2.2",))
75 ((4, "3.0.0.1", ((6, "3.0.0.1.0.1",))))((4, "3.0.0.2",))((2, "3.1", ((4, "3.1.0.1",))))
78 assert_eq!(expected, builder.into_toc());