fixup! test_parse, test_block

This commit is contained in:
Noah Hellman 2022-12-02 20:07:37 +01:00
parent 0d7b19c3d4
commit dc689f976f

View file

@ -403,13 +403,31 @@ mod test {
); );
} }
#[test]
fn parse_blockquote_empty() {
test_parse!(
"> \n",
(Enter(Container(Blockquote)), ">"),
(Element(Blankline), "\n"),
(Exit(Container(Blockquote)), ">"),
);
test_parse!(
">",
(Enter(Container(Blockquote)), ">"),
(Element(Blankline), ""),
(Exit(Container(Blockquote)), ">"),
);
}
#[test] #[test]
fn parse_code_block() { fn parse_code_block() {
test_parse!( test_parse!(
concat!( concat!(
"```\n", "```\n",
"l0\n", "l0\n",
"```", // "```\n",
"\n",
"para\n", //
), ),
(Enter(Leaf(CodeBlock { fence_length: 3 })), "```"), (Enter(Leaf(CodeBlock { fence_length: 3 })), "```"),
(Element(Inline), ""), (Element(Inline), ""),
@ -479,7 +497,7 @@ mod test {
} }
#[test] #[test]
fn block_container() { fn block_blockquote() {
test_block!( test_block!(
concat!( concat!(
"> a\n", // "> a\n", //
@ -493,4 +511,33 @@ mod test {
5, 5,
); );
} }
#[test]
fn block_code_block_seq() {
test_block!(
concat!(
"```` lang\n",
"l0\n",
"```\n",
" l1\n",
"````", //
),
Block::Leaf(CodeBlock { fence_length: 4 }),
"````",
5,
);
test_block!(
concat!(
"```\n", //
"a\n", //
"```\n", //
"```\n", //
"bbb\n", //
"```\n", //
),
Block::Leaf(CodeBlock { fence_length: 3 }),
"```",
3,
);
}
} }