Skip to content

Commit

Permalink
tests: add missing shortcode test
Browse files Browse the repository at this point in the history
  • Loading branch information
charlottia committed Feb 28, 2025
1 parent 7aae1ab commit 819d070
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tests/sourcepos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ const FOOTNOTE_REFERENCE: TestCase = (
"#,
);

#[cfg(feature = "shortcodes")]
const SHORTCODE: TestCase = (
&[sourcepos!((2:2-2:7))],
r#"nya~
!:fire:!
"#,
);

const TABLE: TestCase = (
&[sourcepos!((3:1-5:17))],
r#"stuff before
Expand Down Expand Up @@ -440,6 +448,8 @@ fn node_values() -> HashMap<NodeValueDiscriminants, TestCase> {
ThematicBreak => THEMATIC_BREAK,
FootnoteDefinition => FOOTNOTE_DEFINITION,
FootnoteReference => FOOTNOTE_REFERENCE,
#[cfg(feature = "shortcodes")]
ShortCode => SHORTCODE,
Table => TABLE,
TableRow => TABLE_ROW,
TableCell => TABLE_CELL,
Expand Down Expand Up @@ -485,6 +495,10 @@ fn sourcepos() {
options.extension.superscript = true;
options.extension.subscript = true;
options.extension.autolink = true;
#[cfg(feature = "shortcodes")]
{
options.extension.shortcodes = true;
}
options.extension.math_code = true;
options.extension.math_dollars = true;
options.extension.multiline_block_quotes = true;
Expand Down

0 comments on commit 819d070

Please sign in to comment.