From cd5bb2d16c6b28332b0b6077b27b2b90a8051896 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 6 Oct 2022 15:57:55 +0200 Subject: Refactor to split parse from compile options --- tests/gfm_strikethrough.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'tests/gfm_strikethrough.rs') diff --git a/tests/gfm_strikethrough.rs b/tests/gfm_strikethrough.rs index e392700..ac6b62c 100644 --- a/tests/gfm_strikethrough.rs +++ b/tests/gfm_strikethrough.rs @@ -3,14 +3,17 @@ use micromark::{ mdast::{Delete, Node, Paragraph, Root, Text}, micromark, micromark_to_mdast, micromark_with_options, unist::Position, - Constructs, Options, + Constructs, Options, ParseOptions, }; use pretty_assertions::assert_eq; #[test] fn gfm_strikethrough() -> Result<(), String> { let gfm = Options { - constructs: Constructs::gfm(), + parse: ParseOptions { + constructs: Constructs::gfm(), + ..ParseOptions::default() + }, ..Options::default() }; @@ -368,8 +371,11 @@ u ~**xxx**~ zzz micromark_with_options( "a ~b~ ~~c~~ d", &Options { - constructs: Constructs::gfm(), - gfm_strikethrough_single_tilde: false, + parse: ParseOptions { + constructs: Constructs::gfm(), + gfm_strikethrough_single_tilde: false, + ..ParseOptions::default() + }, ..Options::default() } )?, @@ -381,8 +387,11 @@ u ~**xxx**~ zzz micromark_with_options( "a ~b~ ~~c~~ d", &Options { - constructs: Constructs::gfm(), - gfm_strikethrough_single_tilde: true, + parse: ParseOptions { + constructs: Constructs::gfm(), + gfm_strikethrough_single_tilde: true, + ..ParseOptions::default() + }, ..Options::default() } )?, @@ -391,7 +400,7 @@ u ~**xxx**~ zzz ); assert_eq!( - micromark_to_mdast("a ~~alpha~~ b.", &gfm)?, + micromark_to_mdast("a ~~alpha~~ b.", &gfm.parse)?, Node::Root(Root { children: vec![Node::Paragraph(Paragraph { children: vec![ -- cgit