Format the world
This commit is contained in:
parent
8eb7c58dbb
commit
a06baa56b9
1160 changed files with 65934 additions and 74316 deletions
|
@ -1,4 +1,4 @@
|
|||
use super::{TocBuilder, Toc, TocEntry};
|
||||
use super::{Toc, TocBuilder, TocEntry};
|
||||
|
||||
#[test]
|
||||
fn builder_smoke() {
|
||||
|
@ -9,11 +9,8 @@ fn builder_smoke() {
|
|||
// there's been no macro mistake.
|
||||
macro_rules! push {
|
||||
($level: expr, $name: expr) => {
|
||||
assert_eq!(builder.push($level,
|
||||
$name.to_string(),
|
||||
"".to_string()),
|
||||
$name);
|
||||
}
|
||||
assert_eq!(builder.push($level, $name.to_string(), "".to_string()), $name);
|
||||
};
|
||||
}
|
||||
push!(2, "0.1");
|
||||
push!(1, "1");
|
||||
|
@ -61,20 +58,22 @@ fn builder_smoke() {
|
|||
}
|
||||
}
|
||||
let expected = toc!(
|
||||
(2, "0.1", ),
|
||||
|
||||
(1, "1",
|
||||
((2, "1.1", ((3, "1.1.1", )) ((3, "1.1.2", ))))
|
||||
((2, "1.2", ((3, "1.2.1", )) ((3, "1.2.2", ))))
|
||||
),
|
||||
|
||||
(1, "2", ),
|
||||
|
||||
(1, "3",
|
||||
((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", ))))
|
||||
)
|
||||
);
|
||||
(2, "0.1",),
|
||||
(
|
||||
1,
|
||||
"1",
|
||||
((2, "1.1", ((3, "1.1.1",))((3, "1.1.2",))))((
|
||||
2,
|
||||
"1.2",
|
||||
((3, "1.2.1",))((3, "1.2.2",))
|
||||
))
|
||||
),
|
||||
(1, "2",),
|
||||
(
|
||||
1,
|
||||
"3",
|
||||
((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",))))
|
||||
)
|
||||
);
|
||||
assert_eq!(expected, builder.into_toc());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue