use crate::assert_html_eq; #[test] fn attrs() { let x = "bar"; assert_html_eq!({ a foo=(x) { "Hello" } } => "Hello"); let x = 3; assert_html_eq!({ a foo=(x) { "Hello" } } => "Hello"); } #[test] fn attrs_content_is_escaped() { let x = ""; assert_html_eq!({ a foo=(x) { "Hello" } } => "Hello"); } #[test] fn attrs_without_values_can_be_toggled_with_boolean_valued_expressions() { let x = true; assert_html_eq!({ a foo[x] { "Hello" } } => "Hello"); let x = false; assert_html_eq!({ a foo[x] { "Hello" } } => "Hello"); } #[test] fn attrs_with_values_can_be_toggled_with_option_valued_expressions() { let x = Some(3); assert_html_eq!({ a foo=[x] { "Hello" } } => "Hello"); let x: Option = None; assert_html_eq!({ a foo=[x] { "Hello" } } => "Hello"); }