[librsvg] coord_units.rs: Test the default value and converter
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] coord_units.rs: Test the default value and converter
- Date: Fri, 1 Dec 2017 17:05:36 +0000 (UTC)
commit 900f8e2007a2552fc43dc6c7865853d4ead590d0
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Dec 1 10:23:21 2017 -0600
coord_units.rs: Test the default value and converter
rust/src/coord_units.rs | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/coord_units.rs b/rust/src/coord_units.rs
index 564e232..845961d 100644
--- a/rust/src/coord_units.rs
+++ b/rust/src/coord_units.rs
@@ -80,4 +80,14 @@ mod tests {
assert_eq! (MyUnits::parse ("userSpaceOnUse", ()), Ok (MyUnits(CoordUnits::UserSpaceOnUse)));
assert_eq! (MyUnits::parse ("objectBoundingBox", ()), Ok (MyUnits(CoordUnits::ObjectBoundingBox)));
}
+
+ #[test]
+ fn has_correct_default() {
+ assert_eq!(MyUnits::default(), MyUnits(CoordUnits::ObjectBoundingBox));
+ }
+
+ #[test]
+ fn converts_to_coord_units() {
+ assert_eq!(CoordUnits::from(MyUnits(CoordUnits::ObjectBoundingBox)), CoordUnits::ObjectBoundingBox);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]