use crate::assert_html_eq; #[test] fn class_shorthand() { assert_html_eq!({ a ."foo" { "bar" } } => "bar"); assert_html_eq!({ a .foo { "bar" } } => "bar"); assert_html_eq!({ a .(3) { "bar" } } => "bar"); } #[test] fn class_toggle() { assert_html_eq!({ a .[Some(3)] { "bar" } } => "bar"); assert_html_eq!({ a .[Option::::None] { "bar" } } => "bar"); } #[test] fn id_shorthand() { assert_html_eq!({ a #"foo" { "bar" } } => "bar"); assert_html_eq!({ a #foo { "bar" } } => "bar"); assert_html_eq!({ a #(3) { "bar" } } => "bar"); } #[test] fn id_toggle() { assert_html_eq!({ a #[Some(3)] { "bar" } } => "bar"); assert_html_eq!({ a #[Option::::None] { "bar" } } => "bar"); } #[test] fn class_literal() { assert_html_eq!({ ."headers" {} } => "
"); } #[test] fn class_ident() { assert_html_eq!({ .headers {} } => "
"); assert_html_eq!({ .head-ers {} } => "
"); } #[test] fn id_literal() { assert_html_eq!({ #"headers" {} } => "
"); } #[test] fn id_ident() { assert_html_eq!({ #headers {} } => "
"); assert_html_eq!({ #head-ers {} } => "
"); } #[test] fn class_shorthand_after_valueless_tag() { assert_html_eq!({ a foo-bar #headers {} } => ""); }