diff options
Diffstat (limited to 'tests/unit/style/parsing/mod.rs')
-rw-r--r-- | tests/unit/style/parsing/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs index 4d968cc97d0..d5142efffca 100644 --- a/tests/unit/style/parsing/mod.rs +++ b/tests/unit/style/parsing/mod.rs @@ -58,6 +58,17 @@ macro_rules! assert_roundtrip { } } +macro_rules! assert_parser_exhausted { + ($name:ident, $string:expr, $should_exhausted:expr) => {{ + let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap(); + let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest)); + let mut parser = Parser::new($string); + let parsed = $name::parse(&context, &mut parser); + assert_eq!(parsed.is_ok(), true); + assert_eq!(parser.is_exhausted(), $should_exhausted); + }} +} + macro_rules! parse_longhand { ($name:ident, $s:expr) => {{ let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap(); |