From 5a98a4626d4e87c4681f7f2434bbc56c90bad322 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 14 Jul 2022 19:28:36 +0200 Subject: Fix interrupting sibling list items --- tests/list.rs | 79 +++++++++++++++++++++++++++-------------------------------- 1 file changed, 36 insertions(+), 43 deletions(-) (limited to 'tests') diff --git a/tests/list.rs b/tests/list.rs index d3fcb98..e773a84 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -155,12 +155,11 @@ fn list() { "should support indented code in list items (8)" ); - // To do: list (empty item is allowed to follow another item). - // assert_eq!( - // micromark("-\n foo\n-\n ```\n bar\n ```\n-\n baz"), - // "", - // "should support blank first lines (1)" - // ); + assert_eq!( + micromark("-\n foo\n-\n ```\n bar\n ```\n-\n baz"), + "", + "should support blank first lines (1)" + ); assert_eq!( micromark("- \n foo"), @@ -174,26 +173,23 @@ fn list() { "should support empty only items" ); - // To do: list (empty item is allowed to follow another item). - // assert_eq!( - // micromark("- foo\n-\n- bar"), - // "", - // "should support empty continued items" - // ); + assert_eq!( + micromark("- foo\n-\n- bar"), + "", + "should support empty continued items" + ); - // To do: list (empty item is allowed to follow another item). - // assert_eq!( - // micromark("- foo\n- \n- bar"), - // "", - // "should support blank continued items" - // ); + assert_eq!( + micromark("- foo\n- \n- bar"), + "", + "should support blank continued items" + ); - // To do: list (empty item is allowed to follow another item). - // assert_eq!( - // micromark("1. foo\n2.\n3. bar"), - // "
    \n
  1. foo
  2. \n
  3. \n
  4. bar
  5. \n
", - // "should support empty continued items (ordered)" - // ); + assert_eq!( + micromark("1. foo\n2.\n3. bar"), + "
    \n
  1. foo
  2. \n
  3. \n
  4. bar
  5. \n
", + "should support empty continued items (ordered)" + ); assert_eq!( micromark("*"), @@ -325,12 +321,11 @@ fn list() { "should support interrupting a paragraph" ); - // To do: list (interrupt paragraph). - // assert_eq!( - // micromark("a\n2. b"), - // "

a\n2. b

", - // "should not support interrupting a paragraph with a non-1 numbered item" - // ); + assert_eq!( + micromark("a\n2. b"), + "

a\n2. b

", + "should not support interrupting a paragraph with a non-1 numbered item" + ); assert_eq!( micromark("\n2. a"), @@ -404,12 +399,11 @@ fn list() { "should support loose lists w/ a blank line between (1)" ); - // To do: list (empty item is allowed to follow another item). - // assert_eq!( - // micromark("* a\n*\n\n* c"), - // "", - // "should support loose lists w/ a blank line between (2)" - // ); + assert_eq!( + micromark("* a\n*\n\n* c"), + "", + "should support loose lists w/ a blank line between (2)" + ); assert_eq!( micromark("- a\n- b\n\n c\n- d"), @@ -480,12 +474,11 @@ fn list() { ); // Extra. - // To do: list (empty item is allowed to follow another item). - // assert_eq!( - // micromark("* a\n*\n\n \n\t\n* b"), - // "", - // "should support continued list items after an empty list item w/ many blank lines" - // ); + assert_eq!( + micromark("* a\n*\n\n \n\t\n* b"), + "", + "should support continued list items after an empty list item w/ many blank lines" + ); assert_eq!( micromark("*\n ~~~p\n\n ~~~"), @@ -537,7 +530,7 @@ fn list() { "should remove indent of code (fenced) in list (4 spaces)" ); - // To do: list (some off by one bug with tabs). + // To do: list (something ugly with tabs and counts and skips?). // assert_eq!( // micromark("- ```\n\t\n ```"), // "", -- cgit