-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for elements nested in a list item (#176)
- Loading branch information
1 parent
c848a39
commit f6ebb7d
Showing
3 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
src/interpreter/snapshots/inlyne__interpreter__tests__code_in_ordered_list.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
source: src/interpreter/tests.rs | ||
description: " --- md\n\n1. 1st item\n\n ```rust\n fn main() {}\n ```\n\n2. 2nd item\n\n\n --- html\n\n<ol>\n<li>\n<p>1st item</p>\n<pre style=\"background-color:#f6f8fa;\"><code class=\"language-rust\"><span style=\"font-weight:bold;color:#a71d5d;\">fn </span><span style=\"font-weight:bold;color:#795da3;\">main</span><span style=\"color:#323232;\">() {}\n</span></code></pre>\n</li>\n<li>\n<p>2nd item</p>\n</li>\n</ol>\n" | ||
expression: interpret_md(text) | ||
--- | ||
[ | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "1. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "1st item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
background_color: Some(Color { r: 0.92, g: 0.94, b: 0.96 }), | ||
is_code_block: true, | ||
texts: [ | ||
Text { | ||
text: "fn ", | ||
font_family: Monospace, | ||
color: Some(Color { r: 0.39, g: 0.01, b: 0.11 }), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "main", | ||
font_family: Monospace, | ||
color: Some(Color { r: 0.19, g: 0.11, b: 0.37 }), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "() {}", | ||
font_family: Monospace, | ||
color: Some(Color { r: 0.03, g: 0.03, b: 0.03 }), | ||
.. | ||
}, | ||
Text { | ||
text: "\n", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "2. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "2nd item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
] |
70 changes: 70 additions & 0 deletions
70
src/interpreter/snapshots/inlyne__interpreter__tests__para_in_ordered_list.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
source: src/interpreter/tests.rs | ||
description: " --- md\n\n1. 1st item\n\n Nested paragraph\n\n2. 2nd item\n\n\n --- html\n\n<ol>\n<li>\n<p>1st item</p>\n<p>Nested paragraph</p>\n</li>\n<li>\n<p>2nd item</p>\n</li>\n</ol>\n" | ||
expression: interpret_md(text) | ||
--- | ||
[ | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "1. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "1st item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "Nested paragraph", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "2. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "2nd item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters