Skip to main content

assert_fragments

Macro assert_fragments 

Source
macro_rules! assert_fragments {
    ($fragments:expr, [ $($matcher:expr),* $(,)? ]) => { ... };
}
Expand description

Assert that a fragment list matches the expected pattern.

Each matcher is one of:

  • raw("text") — Raw fragment with exact value
  • signal("name") — Escaped signal
  • signal("name", raw) — Raw (unescaped) signal
  • attr("name", value: "v") — Simple dynamic attribute
  • attr("name", template: "id") — Template attribute
  • attr("name", complex: "v") — Complex (:-prefixed) attribute
  • bool_attr("name", "signal") — Boolean attribute with identifier condition
  • attr_raw("name", "v") — Static attribute with rawValue
  • attr_raw("name", "v", attr_start) — Static rawValue with attrStart
  • attr_skip("name", "v") — Skipped attribute
  • component("id") — Component fragment
  • for_loop("item", "collection", "template") — For loop
  • if_cond("template") — If condition