mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Fix too many parens in @supports serialization.
This commit is contained in:
parent
dbc35f4360
commit
b5d9210f16
3 changed files with 49 additions and 11 deletions
|
@ -39,6 +39,25 @@ macro_rules! assert_roundtrip_with_context {
|
|||
}
|
||||
}
|
||||
|
||||
macro_rules! assert_roundtrip {
|
||||
($fun:expr, $string:expr) => {
|
||||
assert_roundtrip!($fun, $string, $string);
|
||||
};
|
||||
($fun:expr,$input:expr, $output:expr) => {
|
||||
let mut parser = Parser::new($input);
|
||||
let parsed = $fun(&mut parser)
|
||||
.expect(&format!("Failed to parse {}", $input));
|
||||
let serialized = ToCss::to_css_string(&parsed);
|
||||
assert_eq!(serialized, $output);
|
||||
|
||||
let mut parser = Parser::new(&serialized);
|
||||
let re_parsed = $fun(&mut parser)
|
||||
.expect(&format!("Failed to parse serialization {}", $input));
|
||||
let re_serialized = ToCss::to_css_string(&re_parsed);
|
||||
assert_eq!(serialized, re_serialized);
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! parse_longhand {
|
||||
($name:ident, $s:expr) => {{
|
||||
let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
|
||||
|
@ -58,3 +77,4 @@ mod inherited_text;
|
|||
mod mask;
|
||||
mod position;
|
||||
mod selectors;
|
||||
mod supports;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue