[librsvg/librsvg-2.52: 17/18] Fix field names in the backported tests - API changed in 2.54




commit 801921d8f1b2b03759924a76abae58e9bbf0e0f2
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu May 12 16:39:08 2022 -0500

    Fix field names in the backported tests - API changed in 2.54

 tests/src/geometries.rs           | 8 ++++----
 tests/src/primitive_geometries.rs | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/tests/src/geometries.rs b/tests/src/geometries.rs
index 0c25ebce4..919285e79 100644
--- a/tests/src/geometries.rs
+++ b/tests/src/geometries.rs
@@ -87,10 +87,10 @@ fn test(svg_filename: &str) {
         .intrinsic_size_in_pixels()
         .expect("intrinsic size in pixels");
 
-    assert!(matches!(dimensions.width.unit, LengthUnit::Px));
-    assert!(matches!(dimensions.height.unit, LengthUnit::Px));
-    assert_eq!(dimensions.width.length, svg_width);
-    assert_eq!(dimensions.height.length, svg_height);
+    assert!(matches!(dimensions.width.unwrap().unit, LengthUnit::Px));
+    assert!(matches!(dimensions.height.unwrap().unit, LengthUnit::Px));
+    assert_eq!(dimensions.width.unwrap().length, svg_width);
+    assert_eq!(dimensions.height.unwrap().length, svg_height);
 
     for (id, expected) in geometries.0.iter() {
         println!("id: {}", id);
diff --git a/tests/src/primitive_geometries.rs b/tests/src/primitive_geometries.rs
index c544f43df..b65deb3f1 100644
--- a/tests/src/primitive_geometries.rs
+++ b/tests/src/primitive_geometries.rs
@@ -114,10 +114,10 @@ fn test(svg_filename: &str, geometries_filename: &str) {
         .intrinsic_size_in_pixels()
         .expect("intrinsic size in pixels");
 
-    assert!(matches!(dimensions.width.unit, LengthUnit::Px));
-    assert!(matches!(dimensions.height.unit, LengthUnit::Px));
-    assert_eq!(dimensions.width.length, svg_width);
-    assert_eq!(dimensions.height.length, svg_height);
+    assert!(matches!(dimensions.width.unwrap().unit, LengthUnit::Px));
+    assert!(matches!(dimensions.height.unwrap().unit, LengthUnit::Px));
+    assert_eq!(dimensions.width.unwrap().length, svg_width);
+    assert_eq!(dimensions.height.unwrap().length, svg_height);
 
     for (id, expected) in geometries.0.iter() {
         let expected = Element::from_element_geometry(id, expected);


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