Fix the unit tests to make use of local ToCss

This commit is contained in:
Ravi Shankar 2016-11-06 21:26:26 +05:30
parent 6061985898
commit 5ac1c11e9e
8 changed files with 20 additions and 15 deletions

View file

@ -5,6 +5,7 @@
use parsing::parse;
use style::parser::Parse;
use style::values::specified::basic_shape::*;
use style_traits::ToCss;
// Ensure that basic-shape sub-functions parse as both basic shapes
// and their individual components
@ -21,14 +22,14 @@ macro_rules! assert_border_radius_values {
let input = parse(BorderRadius::parse, $input)
.expect(&format!("Failed parsing {} as border radius",
$input));
assert_eq!(::cssparser::ToCss::to_css_string(&input.top_left.0.width), $tlw);
assert_eq!(::cssparser::ToCss::to_css_string(&input.top_right.0.width), $trw);
assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_right.0.width), $brw);
assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_left.0.width), $blw);
assert_eq!(::cssparser::ToCss::to_css_string(&input.top_left.0.height), $tlh);
assert_eq!(::cssparser::ToCss::to_css_string(&input.top_right.0.height), $trh);
assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_right.0.height), $brh);
assert_eq!(::cssparser::ToCss::to_css_string(&input.bottom_left.0.height), $blh);
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);
}
}