From 6be8c58d03f1bc9b72cedf65fdf169a0856722d1 Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Mon, 2 Mar 2026 23:33:22 +0100 Subject: [PATCH] Modified tests to reflect additions in the macros --- tests/tests_divisions.rs | 25 +++++++++++++++++++++++++ tests/{tests.rs => tests_headings.rs} | 0 tests/tests_paragraphs.rs | 13 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 tests/tests_divisions.rs rename tests/{tests.rs => tests_headings.rs} (100%) create mode 100644 tests/tests_paragraphs.rs diff --git a/tests/tests_divisions.rs b/tests/tests_divisions.rs new file mode 100644 index 0000000..259c519 --- /dev/null +++ b/tests/tests_divisions.rs @@ -0,0 +1,25 @@ +#[cfg(test)] +mod tests { + use web_macro::{division, heading1}; + + #[test] + fn test_base() { + assert_eq!("
test
", division!("test")) + } + + #[test] + fn test_multiple_elements() { + assert_eq!( + "
\n

one

\n

two

\n
", + division!(heading1!("one"), heading1!("two")) + ) + } + + #[test] + fn test_multiple_elements_with_options() { + assert_eq!( + "
\n

one

\n

two

\n
", + division!(heading1!("one"), heading1!("two", class="tiny"), id="division_id") + ) + } +} diff --git a/tests/tests.rs b/tests/tests_headings.rs similarity index 100% rename from tests/tests.rs rename to tests/tests_headings.rs diff --git a/tests/tests_paragraphs.rs b/tests/tests_paragraphs.rs new file mode 100644 index 0000000..fbb7e69 --- /dev/null +++ b/tests/tests_paragraphs.rs @@ -0,0 +1,13 @@ +#[cfg(test)] +mod tests { + use web_macro::paragraph; + #[test] + fn test_base() { + assert_eq!("

test

", paragraph!("test")) + } + + #[test] + fn test_params() { + assert_eq!("

test

", paragraph!("test", id = "oui")) + } +}