diff options
| author | 2022-10-13 10:40:01 +0200 | |
|---|---|---|
| committer | 2022-10-13 10:40:01 +0200 | |
| commit | ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a (patch) | |
| tree | 2da4be3be22c2324c48cb17133b3f4b26b9139d2 /tests/mdx_expression_flow.rs | |
| parent | 861af95c119721e814460fa7dc32bd3d74b38484 (diff) | |
| download | markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.gz markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.tar.bz2 markdown-rs-ec2d1bfb4232178fb3a6cba36f138bc6efbbf34a.zip | |
Rename crate to `markdown`
Diffstat (limited to '')
| -rw-r--r-- | tests/mdx_expression_flow.rs | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/tests/mdx_expression_flow.rs b/tests/mdx_expression_flow.rs index 8217c94..b181ef7 100644 --- a/tests/mdx_expression_flow.rs +++ b/tests/mdx_expression_flow.rs @@ -1,8 +1,8 @@ -extern crate micromark; +extern crate markdown; mod test_utils; -use micromark::{ +use markdown::{ mdast::{MdxFlowExpression, Node, Root}, - micromark_to_mdast, micromark_with_options, + to_html_with_options, to_mdast, unist::Position, Constructs, Options, ParseOptions, }; @@ -20,49 +20,49 @@ fn mdx_expression_flow_agnostic() -> Result<(), String> { }; assert_eq!( - micromark_with_options("{a}", &mdx)?, + to_html_with_options("{a}", &mdx)?, "", "should support an expression" ); assert_eq!( - micromark_with_options("{}", &mdx)?, + to_html_with_options("{}", &mdx)?, "", "should support an empty expression" ); assert_eq!( - micromark_with_options("{a", &mdx).err().unwrap(), + to_html_with_options("{a", &mdx).err().unwrap(), "1:3: Unexpected end of file in expression, expected a corresponding closing brace for `{`", "should crash if no closing brace is found (1)" ); assert_eq!( - micromark_with_options("{b { c }", &mdx).err().unwrap(), + to_html_with_options("{b { c }", &mdx).err().unwrap(), "1:9: Unexpected end of file in expression, expected a corresponding closing brace for `{`", "should crash if no closing brace is found (2)" ); assert_eq!( - micromark_with_options("{\n}\na", &mdx)?, + to_html_with_options("{\n}\na", &mdx)?, "<p>a</p>", "should support a line ending in an expression" ); assert_eq!( - micromark_with_options("{ a } \t\nb", &mdx)?, + to_html_with_options("{ a } \t\nb", &mdx)?, "<p>b</p>", "should support expressions followed by spaces" ); assert_eq!( - micromark_with_options(" { a }\nb", &mdx)?, + to_html_with_options(" { a }\nb", &mdx)?, "<p>b</p>", "should support expressions preceded by spaces" ); assert_eq!( - micromark_with_options("> {a\nb}", &mdx) + to_html_with_options("> {a\nb}", &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", @@ -70,19 +70,19 @@ fn mdx_expression_flow_agnostic() -> Result<(), String> { ); assert_eq!( - micromark_with_options("> a\n{b}", &mdx)?, + to_html_with_options("> a\n{b}", &mdx)?, "<blockquote>\n<p>a</p>\n</blockquote>\n", "should not support lazyness (2)" ); assert_eq!( - micromark_with_options("> {a}\nb", &mdx)?, + to_html_with_options("> {a}\nb", &mdx)?, "<blockquote>\n</blockquote>\n<p>b</p>", "should not support lazyness (3)" ); assert_eq!( - micromark_with_options("> {\n> a\nb}", &mdx) + to_html_with_options("> {\n> a\nb}", &mdx) .err() .unwrap(), "3: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", @@ -90,7 +90,7 @@ fn mdx_expression_flow_agnostic() -> Result<(), String> { ); assert_eq!( - micromark_to_mdast("{alpha +\nbravo}", &mdx.parse)?, + to_mdast("{alpha +\nbravo}", &mdx.parse)?, Node::Root(Root { children: vec