30 lines
706 B
Rust
30 lines
706 B
Rust
#[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"
|
|
)
|
|
)
|
|
}
|
|
}
|