Skip to main content

assert_peek_false

Macro assert_peek_false 

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

(Requires feature “testing”) Given a Node, and a string, this will expand to code that sets up a parser, and checks that the Node returns false when Peeking on the node. It also parses using the node, to ensure that the Parse causes an error, confirming that Peek doesn’t contradict Parse. If the parse succeeded this macro will panic with a readable failure.

use css_parse::*;
assert_peek_false!(EmptyAtomSet::ATOMS, T![Ident], "1");