From faca28020f4894bdfcf5a4b164ebbc75864d8776 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 4 Jul 2022 12:16:51 +0200 Subject: Add support for attention (emphasis, strong) --- tests/character_reference.rs | 11 ++-- tests/hard_break_escape.rs | 11 ++-- tests/hard_break_trailing.rs | 77 ++++++++++++-------------- tests/heading_atx.rs | 11 ++-- tests/heading_setext.rs | 44 +++++++-------- tests/html_flow.rs | 127 ++++++++++++++++++++----------------------- tests/image.rs | 55 +++++++++---------- tests/link_reference.rs | 68 +++++++++++------------ tests/link_resource.rs | 24 ++++---- tests/thematic_break.rs | 11 ++-- 10 files changed, 203 insertions(+), 236 deletions(-) (limited to 'tests') diff --git a/tests/character_reference.rs b/tests/character_reference.rs index c87657e..dec1d0c 100644 --- a/tests/character_reference.rs +++ b/tests/character_reference.rs @@ -85,12 +85,11 @@ fn character_reference() { "should not support character references in indented code" ); - // To do: attention. - // assert_eq!( - // micromark("*foo*\n*foo*"), - // "

*foo*\nfoo

", - // "should not support character references as construct markers (1)" - // ); + assert_eq!( + micromark("*foo*\n*foo*"), + "

*foo*\nfoo

", + "should not support character references as construct markers (1)" + ); // To do: list. // assert_eq!( diff --git a/tests/hard_break_escape.rs b/tests/hard_break_escape.rs index 740e706..a486ade 100644 --- a/tests/hard_break_escape.rs +++ b/tests/hard_break_escape.rs @@ -15,12 +15,11 @@ fn hard_break_escape() { "should support leading spaces after an escape hard break" ); - // To do: attention. - // assert_eq!( - // micromark("*foo\\\nbar*"), - // "

foo
\nbar

", - // "should support escape hard breaks in emphasis" - // ); + assert_eq!( + micromark("*foo\\\nbar*"), + "

foo
\nbar

", + "should support escape hard breaks in emphasis" + ); assert_eq!( micromark("``code\\\ntext``"), diff --git a/tests/hard_break_trailing.rs b/tests/hard_break_trailing.rs index 2a4b534..d67ad37 100644 --- a/tests/hard_break_trailing.rs +++ b/tests/hard_break_trailing.rs @@ -21,19 +21,17 @@ fn hard_break_trailing() { "should support leading spaces after a trailing hard break" ); - // To do: attention. - // assert_eq!( - // micromark("*foo \nbar*"), - // "

foo
\nbar

", - // "should support trailing hard breaks in emphasis" - // ); + assert_eq!( + micromark("*foo \nbar*"), + "

foo
\nbar

", + "should support trailing hard breaks in emphasis" + ); - // To do: attention. - // assert_eq!( - // micromark("*foo\\\nbar*"), - // "

foo
\nbar

", - // "should support escape hard breaks in emphasis" - // ); + assert_eq!( + micromark("*foo\\\nbar*"), + "

foo
\nbar

", + "should support escape hard breaks in emphasis" + ); assert_eq!( micromark("`code \ntext`"), @@ -83,40 +81,35 @@ fn hard_break_trailing() { "should support a line suffix after a replacement character" ); - // To do: attention. - // assert_eq!( - // micromark("*a* \nbb"), - // "

a
\nbb

", - // "should support a hard break after a span" - // ); + assert_eq!( + micromark("*a* \nbb"), + "

a
\nbb

", + "should support a hard break after a span" + ); - // To do: attention. - // assert_eq!( - // micromark("*a*\t\nbb"), - // "

a\nbb

", - // "should support a line suffix after a span" - // ); + assert_eq!( + micromark("*a*\t\nbb"), + "

a\nbb

", + "should support a line suffix after a span" + ); - // To do: attention. - // assert_eq!( - // micromark("*a* \t\nbb"), - // "

a\nbb

", - // "should support a mixed line suffix after a span (1)" - // ); + assert_eq!( + micromark("*a* \t\nbb"), + "

a\nbb

", + "should support a mixed line suffix after a span (1)" + ); - // To do: attention. - // assert_eq!( - // micromark("*a*\t \nbb"), - // "

a\nbb

", - // "should support a mixed line suffix after a span (2)" - // ); + assert_eq!( + micromark("*a*\t \nbb"), + "

a\nbb

", + "should support a mixed line suffix after a span (2)" + ); - // To do: attention. - // assert_eq!( - // micromark("*a* \t \nbb"), - // "

a\nbb

", - // "should support a mixed line suffix after a span (3)" - // ); + assert_eq!( + micromark("*a* \t \nbb"), + "

a\nbb

", + "should support a mixed line suffix after a span (3)" + ); // // To do: turning things off. // assert_eq!( diff --git a/tests/heading_atx.rs b/tests/heading_atx.rs index ef5846a..c9aa803 100644 --- a/tests/heading_atx.rs +++ b/tests/heading_atx.rs @@ -62,12 +62,11 @@ fn heading_atx() { "should not support a heading for an escaped number sign" ); - // To do: attention. - // assert_eq!( - // micromark("# foo *bar* \\*baz\\*"), - // "

foo bar *baz*

", - // "should support text content in headings" - // ); + assert_eq!( + micromark("# foo *bar* \\*baz\\*"), + "

foo bar *baz*

", + "should support text content in headings" + ); assert_eq!( micromark("# foo "), diff --git a/tests/heading_setext.rs b/tests/heading_setext.rs index e7ee9ff..3c8b892 100644 --- a/tests/heading_setext.rs +++ b/tests/heading_setext.rs @@ -3,33 +3,29 @@ use micromark::micromark; #[test] fn heading_setext() { - // To do: attention. - // assert_eq!( - // micromark("Foo *bar*\n========="), - // "

Foo bar

", - // "should support a heading w/ an equals to (rank of 1)" - // ); + assert_eq!( + micromark("Foo *bar*\n========="), + "

Foo bar

", + "should support a heading w/ an equals to (rank of 1)" + ); - // To do: attention. - // assert_eq!( - // micromark("Foo *bar*\n---------"), - // "

Foo bar

", - // "should support a heading w/ a dash (rank of 2)" - // ); + assert_eq!( + micromark("Foo *bar*\n---------"), + "

Foo bar

", + "should support a heading w/ a dash (rank of 2)" + ); - // To do: attention. - // assert_eq!( - // micromark("Foo *bar\nbaz*\n===="), - // "

Foo bar\nbaz

", - // "should support line endings in setext headings" - // ); + assert_eq!( + micromark("Foo *bar\nbaz*\n===="), + "

Foo bar\nbaz

", + "should support line endings in setext headings" + ); - // To do: attention. - // assert_eq!( - // micromark(" Foo *bar\nbaz*\t\n===="), - // "

Foo bar\nbaz

", - // "should not include initial and final whitespace around content" - // ); + assert_eq!( + micromark(" Foo *bar\nbaz*\t\n===="), + "

Foo bar\nbaz

", + "should not include initial and final whitespace around content" + ); assert_eq!( micromark("Foo\n-------------------------"), diff --git a/tests/html_flow.rs b/tests/html_flow.rs index 3b69671..348da8d 100644 --- a/tests/html_flow.rs +++ b/tests/html_flow.rs @@ -98,12 +98,11 @@ p {color:blue;} "should support raw tags w/o ending" ); - // To do: attention. - // assert_eq!( - // micromark_with_options("\n*foo*", DANGER), - // "\n

foo

", - // "should support raw tags w/ start and end on a single line" - // ); + assert_eq!( + micromark_with_options("\n*foo*", DANGER), + "\n

foo

", + "should support raw tags w/ start and end on a single line" + ); assert_eq!( micromark_with_options("1. *bar*", DANGER), @@ -129,12 +128,11 @@ p {color:blue;} "should not support an eof after a self-closing slash" ); - // To do: attention. - // assert_eq!( - // micromark_with_options("