From 246063fb7cd21a83beae5934f95b2795fb85df51 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 14 Oct 2022 10:49:28 +0200 Subject: Refactor to use default trait in tests --- tests/gfm_task_list_item.rs | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'tests/gfm_task_list_item.rs') diff --git a/tests/gfm_task_list_item.rs b/tests/gfm_task_list_item.rs index 0ef6ea3..7c68b21 100644 --- a/tests/gfm_task_list_item.rs +++ b/tests/gfm_task_list_item.rs @@ -3,20 +3,12 @@ use markdown::{ mdast::{List, ListItem, Node, Paragraph, Root, Text}, to_html, to_html_with_options, to_mdast, unist::Position, - Constructs, Options, ParseOptions, + Options, ParseOptions, }; use pretty_assertions::assert_eq; #[test] fn gfm_task_list_item() -> Result<(), String> { - let gfm = Options { - parse: ParseOptions { - constructs: Constructs::gfm(), - ..ParseOptions::default() - }, - ..Options::default() - }; - assert_eq!( to_html("* [x] y."), "", @@ -24,25 +16,25 @@ fn gfm_task_list_item() -> Result<(), String> { ); assert_eq!( - to_html_with_options("* [x] y.", &gfm)?, + to_html_with_options("* [x] y.", &Options::gfm())?, "", "should support task list item checks" ); assert_eq!( - to_html_with_options("* [ ] z.", &gfm)?, + to_html_with_options("* [ ] z.", &Options::gfm())?, "", "should support unchecked task list item checks" ); assert_eq!( - to_html_with_options("*\n [x]", &gfm)?, + to_html_with_options("*\n [x]", &Options::gfm())?, "", "should not support laziness (1)" ); assert_eq!( - to_html_with_options("*\n[x]", &gfm)?, + to_html_with_options("*\n[x]", &Options::gfm())?, "\n

[x]

", "should not support laziness (2)" ); @@ -129,7 +121,7 @@ EOL after: "### .replace('␠', " ") .replace('␉', "\t"), - &gfm + &Options::gfm() )?, r###"