[librsvg] parsers: Test that number_and_units() can parse percentages and units beginning with "e"



commit 10711bb1a54f6f772b468c214e92b6fd0ede81a9
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Jul 19 13:45:39 2017 -0500

    parsers: Test that number_and_units() can parse percentages and units beginning with "e"

 rust/src/parsers.rs |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/parsers.rs b/rust/src/parsers.rs
index c0a3423..e3f9b46 100644
--- a/rust/src/parsers.rs
+++ b/rust/src/parsers.rs
@@ -449,6 +449,8 @@ mod tests {
         assert_eq! (number_and_units ("-1"), Ok ((-1.0, "")));
         assert_eq! (number_and_units ("0x"), Ok ((0.0, "x")));
         assert_eq! (number_and_units ("-55.5x-large"), Ok ((-55.5, "x-large")));
+        assert_eq! (number_and_units ("10%"), Ok ((10.0, "%")));
+        assert_eq! (number_and_units ("10em"), Ok ((10.0, "em")));
     }
 
     #[test]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]