aboutsummaryrefslogtreecommitdiffstats
path: root/tests/code_indented.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 15:57:55 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 15:57:55 +0200
commitcd5bb2d16c6b28332b0b6077b27b2b90a8051896 (patch)
tree848ebc6200b80d2dfdcd67bf0bb245eea06bb24f /tests/code_indented.rs
parent6e80e03bb6d6af47aba2b339f160e4895ab5afba (diff)
downloadmarkdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.gz
markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.bz2
markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.zip
Refactor to split parse from compile options
Diffstat (limited to '')
-rw-r--r--tests/code_indented.rs28
1 files changed, 18 insertions, 10 deletions
diff --git a/tests/code_indented.rs b/tests/code_indented.rs
index 7ea08b5..fd539d3 100644
--- a/tests/code_indented.rs
+++ b/tests/code_indented.rs
@@ -3,7 +3,7 @@ use micromark::{
mdast::{Code, Node, Root},
micromark, micromark_to_mdast, micromark_with_options,
unist::Position,
- Constructs, Options,
+ CompileOptions, Constructs, Options, ParseOptions,
};
use pretty_assertions::assert_eq;
@@ -124,9 +124,12 @@ fn code_indented() -> Result<(), String> {
);
let off = Options {
- constructs: Constructs {
- code_indented: false,
- ..Constructs::default()
+ parse: ParseOptions {
+ constructs: Constructs {
+ code_indented: false,
+ ..Constructs::default()
+ },
+ ..ParseOptions::default()
},
..Options::default()
};
@@ -171,12 +174,17 @@ fn code_indented() -> Result<(), String> {
micromark_with_options(
"a <?\n ?>",
&Options {
- allow_dangerous_html: true,
- constructs: Constructs {
- code_indented: false,
- ..Constructs::default()
+ parse: ParseOptions {
+ constructs: Constructs {
+ code_indented: false,
+ ..Constructs::default()
+ },
+ ..ParseOptions::default()
},
- ..Options::default()
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ ..CompileOptions::default()
+ }
}
)?,
"<p>a <?\n?></p>",
@@ -198,7 +206,7 @@ fn code_indented() -> Result<(), String> {
assert_eq!(
micromark_to_mdast(
"\tconsole.log(1)\n console.log(2)\n",
- &Options::default()
+ &ParseOptions::default()
)?,
Node::Root(Root {
children: vec![Node::Code(Code {