Skip to main content

assert_semantic_eq

Macro assert_semantic_eq 

Source
macro_rules! assert_semantic_eq {
    ($atomset: path, $ty: ty, $a: literal, $b: literal) => { ... };
}
Expand description

(Requires feature “testing”) Given a Node and two strings, this will expand to code that sets up a parser, parses both strings as the given Node from a single source text, and asserts that the two parsed Nodes are equal according to SemanticEq. If either parse fails, or the nodes are not semantically equal, this macro will panic with a readable failure.

use css_parse::*;
assert_semantic_eq!(EmptyAtomSet::ATOMS, T![Ident], "foo", "FoO");