1 use super::{TocBuilder, Toc, 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,
37 push!(6, "3.0.0.1.0.1");
47 ($(($level: expr, $name: expr, $(($sub: tt))* )),*) => {
53 name: $name.to_string(),
54 sec_number: $name.to_string(),
56 children: toc!($($sub),*)
67 ((2, "1.1", ((3, "1.1.1", )) ((3, "1.1.2", ))))
68 ((2, "1.2", ((3, "1.2.1", )) ((3, "1.2.2", ))))
74 ((4, "3.0.0.1", ((6, "3.0.0.1.0.1", ))))
76 ((2, "3.1", ((4, "3.1.0.1", ))))
79 assert_eq!(expected, builder.into_toc());