From 645fb2b02b1563bd98c07515bdc2d6d8478ba74e Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 13 Oct 2022 13:32:32 +0200 Subject: Add a bunch more tests for frontmatter --- src/construct/frontmatter.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/construct/frontmatter.rs') diff --git a/src/construct/frontmatter.rs b/src/construct/frontmatter.rs index 268d91d..f4774d6 100644 --- a/src/construct/frontmatter.rs +++ b/src/construct/frontmatter.rs @@ -281,13 +281,10 @@ pub fn content_end(tokenizer: &mut Tokenizer) -> State { /// ^ /// ``` pub fn after(tokenizer: &mut Tokenizer) -> State { - tokenizer.tokenize_state.marker = 0; - - match tokenizer.current { - None | Some(b'\n') => { - tokenizer.exit(Name::Frontmatter); - State::Ok - } - _ => State::Nok, - } + debug_assert!( + matches!(tokenizer.current, None | Some(b'\n')), + "expected eol/eof after closing fence" + ); + tokenizer.exit(Name::Frontmatter); + State::Ok } -- cgit