From 55a6f8560cf88b655f49f1a1a59f6c1dc6afe022 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 5 Jul 2022 13:49:56 +0200 Subject: Fix resizing attention bug --- tests/attention.rs | 66 ++++++++++++++++++++++------------------------- tests/link_reference.rs | 68 ++++++++++++++++++++++++------------------------- tests/link_resource.rs | 11 ++++---- 3 files changed, 68 insertions(+), 77 deletions(-) (limited to 'tests') diff --git a/tests/attention.rs b/tests/attention.rs index 11ba7d8..6ab173b 100644 --- a/tests/attention.rs +++ b/tests/attention.rs @@ -559,12 +559,11 @@ fn attention() { "should support strong emphasis around the other marker" ); - // To do: resizing attention bug? - // assert_eq!( - // micromark("**foo*"), - // "

*foo

", - // "should support a superfluous marker at the start of emphasis" - // ); + assert_eq!( + micromark("**foo*"), + "

*foo

", + "should support a superfluous marker at the start of emphasis" + ); assert_eq!( micromark("*foo**"), @@ -572,19 +571,17 @@ fn attention() { "should support a superfluous marker at the end of emphasis" ); - // To do: resizing attention bug? - // assert_eq!( - // micromark("***foo**"), - // "

*foo

", - // "should support a superfluous marker at the start of strong" - // ); + assert_eq!( + micromark("***foo**"), + "

*foo

", + "should support a superfluous marker at the start of strong" + ); - // To do: resizing attention bug? - // assert_eq!( - // micromark("****foo*"), - // "

***foo

", - // "should support multiple superfluous markers at the start of strong" - // ); + assert_eq!( + micromark("****foo*"), + "

***foo

", + "should support multiple superfluous markers at the start of strong" + ); assert_eq!( micromark("**foo***"), @@ -635,12 +632,11 @@ fn attention() { "should support strong emphasis around the other marker" ); - // To do: resizing attention bug? - // assert_eq!( - // micromark("__foo_"), - // "

_foo

", - // "should support a superfluous marker at the start of emphasis" - // ); + assert_eq!( + micromark("__foo_"), + "

_foo

", + "should support a superfluous marker at the start of emphasis" + ); assert_eq!( micromark("_foo__"), @@ -648,19 +644,17 @@ fn attention() { "should support a superfluous marker at the end of emphasis" ); - // To do: resizing attention bug? - // assert_eq!( - // micromark("___foo__"), - // "

_foo

", - // "should support a superfluous marker at the start of strong" - // ); + assert_eq!( + micromark("___foo__"), + "

_foo

", + "should support a superfluous marker at the start of strong" + ); - // To do: resizing attention bug? - // assert_eq!( - // micromark("____foo_"), - // "

___foo

", - // "should support multiple superfluous markers at the start of strong" - // ); + assert_eq!( + micromark("____foo_"), + "

___foo

", + "should support multiple superfluous markers at the start of strong" + ); assert_eq!( micromark("__foo___"), diff --git a/tests/link_reference.rs b/tests/link_reference.rs index 3a0be9f..b53b99b 100644 --- a/tests/link_reference.rs +++ b/tests/link_reference.rs @@ -27,12 +27,11 @@ fn link_reference() { "should support escaped brackets in link references" ); - // To do: link/attention interplay. - // assert_eq!( - // micromark("[ref]: /uri\n\n[link *foo **bar** `#`*][ref]"), - // "

link foo bar #

", - // "should support content in link references" - // ); + assert_eq!( + micromark("[ref]: /uri\n\n[link *foo **bar** `#`*][ref]"), + "

link foo bar #

", + "should support content in link references" + ); assert_eq!( micromark("[ref]: /uri\n\n[![moon](moon.jpg)][ref]"), @@ -336,35 +335,34 @@ fn link_reference() { "should not support mismatched character references in fulls" ); - // To do: link/attention interplay. - // assert_eq!( - // micromark( - // "[*f*][] - // [;][] - // [\\;][] - // [;][] - // [*f*;][] - // [*f*\\;][] - // [*f*;][] - - // [*f*]: alpha - // [;]: bravo - // [\\;]: charlie - // [;]: delta - // [*f*;]: echo - // [*f*\\;]: foxtrot - // [*f*;]: golf" - // ), - // "

f - // ; - // ; - // ; - // f; - // f; - // f;

- // ", - // "should properly handle labels w/ character references and -escapes, and phrasing" - // ); + assert_eq!( + micromark( + "[*f*][] +[;][] +[\\;][] +[;][] +[*f*;][] +[*f*\\;][] +[*f*;][] + +[*f*]: alpha +[;]: bravo +[\\;]: charlie +[;]: delta +[*f*;]: echo +[*f*\\;]: foxtrot +[*f*;]: golf" + ), + "

f +; +; +; +f; +f; +f;

+", + "should properly handle labels w/ character references and -escapes, and phrasing" + ); // 999 `x` characters. let max = "x".repeat(999); diff --git a/tests/link_resource.rs b/tests/link_resource.rs index bebf6cc..e4037a2 100644 --- a/tests/link_resource.rs +++ b/tests/link_resource.rs @@ -231,12 +231,11 @@ fn link_resource() { "should support characer escapes" ); - // To do: link/attention interplay. - // assert_eq!( - // micromark("[link *foo **bar** `#`*](/uri)"), - // "

link foo bar #

", - // "should support content" - // ); + assert_eq!( + micromark("[link *foo **bar** `#`*](/uri)"), + "

link foo bar #

", + "should support content" + ); assert_eq!( micromark("[![moon](moon.jpg)](/uri)"), -- cgit