forked from bai/curriculum-project-hub
feat(cph): add outline export command
This commit is contained in:
@@ -45,6 +45,23 @@ fn good_fixture_has_no_errors() {
|
||||
assert!(!report.has_errors());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn outline_projects_parts_in_manifest_order() {
|
||||
let (outline, report) = cph_check::outline(&mini_fixture());
|
||||
assert_eq!(
|
||||
report.error_count(),
|
||||
0,
|
||||
"outline should validate the fixture"
|
||||
);
|
||||
let outline = outline.expect("valid lesson should produce an outline");
|
||||
assert_eq!(outline.title, "迷你示例课时");
|
||||
assert_eq!(outline.children.len(), 3);
|
||||
assert_eq!(outline.children[0].title, "开场对照导言");
|
||||
assert_eq!(outline.children[1].kind, "section");
|
||||
assert_eq!(outline.children[1].children[0].title, "量纲分析估计");
|
||||
assert_eq!(outline.children[2].title, "自由落体");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unknown_kind_is_an_error() {
|
||||
// Build a throwaway lesson whose part declares kind "frob".
|
||||
|
||||
Reference in New Issue
Block a user