From 1696f5680e069f637703c97b264afc75d37672fc Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 30 Apr 2025 06:36:09 -0700 Subject: [PATCH] Move footnote expected HTML to a separate file This output is starting to get a little long, so this moves it to a separate file to keep things a little more tidy. --- tests/testsuite/markdown.rs | 46 ++----------------- .../footnotes/expected/footnotes.html | 38 +++++++++++++++ 2 files changed, 43 insertions(+), 41 deletions(-) create mode 100644 tests/testsuite/markdown/footnotes/expected/footnotes.html diff --git a/tests/testsuite/markdown.rs b/tests/testsuite/markdown.rs index 50471826..537a8e06 100644 --- a/tests/testsuite/markdown.rs +++ b/tests/testsuite/markdown.rs @@ -1,6 +1,7 @@ //! Tests for special markdown rendering. use crate::prelude::*; +use snapbox::file; // Checks custom header id and classes. #[test] @@ -16,47 +17,10 @@ fn custom_header_attributes() { // Test for a variety of footnote renderings. #[test] fn footnotes() { - BookTest::from_dir("markdown/footnotes") - .check_main_file("book/footnotes.html", str![[r##" -

Footnote tests

-

Footnote example1, or with a word2.

-

There are multiple references to word2.

-

Footnote without a paragraph3

-

Footnote with multiple paragraphs4

-

Footnote name with wacky characters5

-

Testing when referring to something earlier.6

-
-
  1. -

    This is a footnote. ↩2

    -
  2. -
  3. -

    A longer footnote. -With multiple lines. Link to other. -With a reference inside.1 ↩2

    -
  4. -
  5. -
      -
    1. Item one -
        -
      1. Sub-item
      2. -
      -
    2. -
    3. Item two
    4. -
    -
  6. -
  7. -

    One

    -

    Two

    -

    Three

    -
  8. -
  9. -

    Testing footnote id with special characters.

    -
  10. -
  11. -

    This is defined before it is referred to.

    -
  12. -
-"##]]); + BookTest::from_dir("markdown/footnotes").check_main_file( + "book/footnotes.html", + file!["markdown/footnotes/expected/footnotes.html"], + ); } // Basic table test. diff --git a/tests/testsuite/markdown/footnotes/expected/footnotes.html b/tests/testsuite/markdown/footnotes/expected/footnotes.html new file mode 100644 index 00000000..84b16975 --- /dev/null +++ b/tests/testsuite/markdown/footnotes/expected/footnotes.html @@ -0,0 +1,38 @@ +

Footnote tests

+

Footnote example1, or with a word2.

+

There are multiple references to word2.

+

Footnote without a paragraph3

+

Footnote with multiple paragraphs4

+

Footnote name with wacky characters5

+

Testing when referring to something earlier.6

+
+
  1. +

    This is a footnote. ↩2

    +
  2. +
  3. +

    A longer footnote. +With multiple lines. Link to other. +With a reference inside.1 ↩2

    +
  4. +
  5. +
      +
    1. Item one +
        +
      1. Sub-item
      2. +
      +
    2. +
    3. Item two
    4. +
    +
  6. +
  7. +

    One

    +

    Two

    +

    Three

    +
  8. +
  9. +

    Testing footnote id with special characters.

    +
  10. +
  11. +

    This is defined before it is referred to.

    +
  12. +
\ No newline at end of file