Modified tests to reflect additions in the macros
This commit is contained in:
25
tests/tests_divisions.rs
Normal file
25
tests/tests_divisions.rs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use web_macro::{division, heading1};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_base() {
|
||||||
|
assert_eq!("<div>test</div>", division!("test"))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_multiple_elements() {
|
||||||
|
assert_eq!(
|
||||||
|
"<div>\n<h1>one</h1>\n<h1>two</h1>\n</div>",
|
||||||
|
division!(heading1!("one"), heading1!("two"))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_multiple_elements_with_options() {
|
||||||
|
assert_eq!(
|
||||||
|
"<div id=\"division_id\">\n<h1>one</h1>\n<h1 class=\"tiny\">two</h1>\n</div>",
|
||||||
|
division!(heading1!("one"), heading1!("two", class="tiny"), id="division_id")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
13
tests/tests_paragraphs.rs
Normal file
13
tests/tests_paragraphs.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use web_macro::paragraph;
|
||||||
|
#[test]
|
||||||
|
fn test_base() {
|
||||||
|
assert_eq!("<p>test</p>", paragraph!("test"))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_params() {
|
||||||
|
assert_eq!("<p id=\"oui\">test</p>", paragraph!("test", id = "oui"))
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user