[librsvg: 2/8] Test for no intrinsic size at all




commit b799710f51363e89291ba81e925c1c217036e1c1
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 30 17:10:19 2021 -0500

    Test for no intrinsic size at all
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/595>

 tests/src/legacy_sizing.rs | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
---
diff --git a/tests/src/legacy_sizing.rs b/tests/src/legacy_sizing.rs
index c8a9cb65..1e0cac9a 100644
--- a/tests/src/legacy_sizing.rs
+++ b/tests/src/legacy_sizing.rs
@@ -29,3 +29,31 @@ fn just_viewbox_uses_viewbox_size() {
          })
     );
 }
+
+#[test]
+fn no_intrinsic_size_uses_element_geometries() {
+    let svg = load_svg(
+        br#"<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg";>
+  <rect x="10" y="20" width="30" height="40" fill="black"/>
+</svg>
+"#,
+    )
+        .unwrap();
+
+    assert_eq!(
+        CairoRenderer::new(&svg).legacy_layer_geometry(None).unwrap(),
+        (cairo::Rectangle {
+            x: 10.0,
+            y: 20.0,
+            width: 30.0,
+            height: 40.0,
+        },
+         cairo::Rectangle {
+             x: 10.0,
+             y: 20.0,
+             width: 30.0,
+             height: 40.0,
+         })
+    );
+}


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