Format remaining files

This commit is contained in:
Pyfisch 2018-11-06 13:01:35 +01:00
parent bf47f90da6
commit cb07debcb6
252 changed files with 5944 additions and 3744 deletions

View file

@ -13,31 +13,60 @@ use style_traits::ToCss;
macro_rules! assert_longhand {
($parsed_shorthand: expr, $prop: ident, $value_string: expr) => {
assert_eq!($parsed_shorthand.$prop, parse_longhand!($prop, $value_string).maybe_boxed())
}
assert_eq!(
$parsed_shorthand.$prop,
parse_longhand!($prop, $value_string).maybe_boxed()
)
};
}
macro_rules! assert_initial {
($parsed_shorthand: expr, $prop: ident) => {
assert_eq!($parsed_shorthand.$prop, $prop::get_initial_specified_value().maybe_boxed())
}
assert_eq!(
$parsed_shorthand.$prop,
$prop::get_initial_specified_value().maybe_boxed()
)
};
}
macro_rules! assert_border_radius_values {
($input:expr; $tlw:expr, $trw:expr, $brw:expr, $blw:expr ;
$tlh:expr, $trh:expr, $brh:expr, $blh:expr) => {
let input = parse(BorderRadius::parse, $input)
.expect(&format!("Failed parsing {} as border radius",
$input));
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_left.0.width()), $tlw);
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_right.0.width()), $trw);
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_right.0.width()), $brw);
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_left.0.width()), $blw);
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_left.0.height()), $tlh);
assert_eq!(::style_traits::ToCss::to_css_string(&input.top_right.0.height()), $trh);
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_right.0.height()), $brh);
assert_eq!(::style_traits::ToCss::to_css_string(&input.bottom_left.0.height()), $blh);
}
.expect(&format!("Failed parsing {} as border radius", $input));
assert_eq!(
::style_traits::ToCss::to_css_string(&input.top_left.0.width()),
$tlw
);
assert_eq!(
::style_traits::ToCss::to_css_string(&input.top_right.0.width()),
$trw
);
assert_eq!(
::style_traits::ToCss::to_css_string(&input.bottom_right.0.width()),
$brw
);
assert_eq!(
::style_traits::ToCss::to_css_string(&input.bottom_left.0.width()),
$blw
);
assert_eq!(
::style_traits::ToCss::to_css_string(&input.top_left.0.height()),
$tlh
);
assert_eq!(
::style_traits::ToCss::to_css_string(&input.top_right.0.height()),
$trh
);
assert_eq!(
::style_traits::ToCss::to_css_string(&input.bottom_right.0.height()),
$brh
);
assert_eq!(
::style_traits::ToCss::to_css_string(&input.bottom_left.0.height()),
$blh
);
};
}
#[test]