Test failure in SUMMARY.md when item is not a link

This commit is contained in:
Gabor Szabo 2025-03-03 10:33:27 +02:00
parent 19146c403e
commit e7418f21f9

View file

@ -749,6 +749,18 @@ mod tests {
assert!(got.is_err());
}
#[test]
fn expected_a_start_of_a_link() {
let src = "- Title\n";
let mut parser = SummaryParser::new(src);
let got = parser.parse_affix(false);
assert!(got.is_err());
let error_message = got.err().unwrap().to_string();
assert_eq!(error_message, "failed to parse SUMMARY.md line 1, column 0: Suffix chapters cannot be followed by a list");
}
#[test]
fn parse_a_link() {
let src = "[First](./first.md)";