From 4711b1f0720eb54e458ca5a16cb655013693b628 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 9 Sep 2022 15:42:07 +0200 Subject: Add support for mdx attribute (value) expressions --- tests/mdx_jsx_flow.rs | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'tests/mdx_jsx_flow.rs') diff --git a/tests/mdx_jsx_flow.rs b/tests/mdx_jsx_flow.rs index ff53dcb..9b0453f 100644 --- a/tests/mdx_jsx_flow.rs +++ b/tests/mdx_jsx_flow.rs @@ -33,12 +33,11 @@ fn mdx_jsx_flow_agnostic() -> Result<(), String> { "should support an element w/ containers as content" ); - // To do: expressions. - // assert_eq!( - // micromark_with_options("", &mdx)?, - // "", - // "should support attributes" - // ); + assert_eq!( + micromark_with_options("", &mdx)?, + "", + "should support attributes" + ); Ok(()) } @@ -97,7 +96,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> d", &mdx) + micromark_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -105,7 +104,7 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> d", &mdx) + micromark_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", @@ -113,17 +112,33 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> e", &mdx) + micromark_with_options("> ", &mdx) .err() .unwrap(), "2:1: Unexpected lazy line in jsx in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", "should not support lazy flow (4)" ); + assert_eq!( + micromark_with_options("> ", &mdx) + .err() + .unwrap(), + "2:1: Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", + "should not support lazy flow (5)" + ); + + assert_eq!( + micromark_with_options("> ", &mdx) + .err() + .unwrap(), + "2:1: Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", + "should not support lazy flow (6)" + ); + assert_eq!( micromark_with_options("> a\n", &mdx)?, "
\n

a

\n
\n", - "should not support lazy flow (5)" + "should not support lazy flow (7)" ); Ok(()) -- cgit