diff options
Diffstat (limited to '')
-rw-r--r-- | tests/mdx_jsx_flow.rs | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/mdx_jsx_flow.rs b/tests/mdx_jsx_flow.rs index 9b0453f..14e14f0 100644 --- a/tests/mdx_jsx_flow.rs +++ b/tests/mdx_jsx_flow.rs @@ -1,5 +1,8 @@ extern crate micromark; -use micromark::{micromark_with_options, Constructs, Options}; +use micromark::{ + mdast::{List, ListItem, MdxJsxFlowElement, Node, Paragraph, Position, Root, Text}, + micromark_to_mdast, micromark_with_options, Constructs, Options, +}; use pretty_assertions::assert_eq; #[test] @@ -141,5 +144,36 @@ fn mdx_jsx_flow_essence() -> Result<(), String> { "should not support lazy flow (7)" ); + assert_eq!( + micromark_to_mdast("<>\n * a\n</>", &mdx)?, + Node::Root(Root { + children: vec![Node::MdxJsxFlowElement(MdxJsxFlowElement { + name: None, + attributes: vec![], + children: vec![Node::List(List { + ordered: false, + spread: false, + start: None, + children: vec![Node::ListItem(ListItem { + checked: None, + spread: false, + children: vec![Node::Paragraph(Paragraph { + children: vec![Node::Text(Text { + value: "a".to_string(), + position: Some(Position::new(2, 5, 7, 2, 6, 8)) + }),], + position: Some(Position::new(2, 5, 7, 2, 6, 8)) + })], + position: Some(Position::new(2, 1, 3, 2, 6, 8)) + })], + position: Some(Position::new(2, 1, 3, 2, 6, 8)) + })], + position: Some(Position::new(1, 1, 0, 3, 4, 12)) + })], + position: Some(Position::new(1, 1, 0, 3, 4, 12)) + }), + "should support mdx jsx (flow) as `MdxJsxFlowElement`s in mdast" + ); + Ok(()) } |