mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Make util::str::parse_length work with floats
This commit is contained in:
parent
02a8e8dd16
commit
30ea772939
4 changed files with 4 additions and 1 deletions
|
@ -17,6 +17,7 @@ pub fn test_parse_length() {
|
|||
check("0", LengthOrPercentageOrAuto::Length(Au::from_px(0)));
|
||||
check("0.000%", LengthOrPercentageOrAuto::Percentage(0.0));
|
||||
check("+5.82%", LengthOrPercentageOrAuto::Percentage(0.0582));
|
||||
check("5.82", LengthOrPercentageOrAuto::Length(Au::from_f64_px(5.82)));
|
||||
check("invalid", LengthOrPercentageOrAuto::Auto);
|
||||
check("12 followed by invalid", LengthOrPercentageOrAuto::Length(Au::from_px(12)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue