[librsvg: 10/15] Add test for a rect in an isolation context




commit 7f858c704d5c5533ed0152378ca47dbb561a4d8d
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon May 9 14:22:24 2022 -0500

    Add test for a rect in an isolation context
    
    This still passes; the next one will fail.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/697>

 tests/fixtures/primitive_geometries/rect_isolate.svg     |  4 ++++
 .../fixtures/primitive_geometries/rect_isolate.svg.geom  | 16 ++++++++++++++++
 tests/src/primitive_geometries.rs                        | 14 +++++++++++++-
 3 files changed, 33 insertions(+), 1 deletion(-)
---
diff --git a/tests/fixtures/primitive_geometries/rect_isolate.svg 
b/tests/fixtures/primitive_geometries/rect_isolate.svg
new file mode 100644
index 000000000..2a43006bd
--- /dev/null
+++ b/tests/fixtures/primitive_geometries/rect_isolate.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; width="100" height="100">
+  <rect id="a" x="10" y="20" width="30" height="40" style="isolation: isolate;"/>
+</svg>
diff --git a/tests/fixtures/primitive_geometries/rect_isolate.svg.geom 
b/tests/fixtures/primitive_geometries/rect_isolate.svg.geom
new file mode 100644
index 000000000..09c7255cd
--- /dev/null
+++ b/tests/fixtures/primitive_geometries/rect_isolate.svg.geom
@@ -0,0 +1,16 @@
+{
+    "#a": {
+        "ink_rect": {
+            "x": 10.0,
+            "y": 20.0,
+            "width": 30.0,
+            "height": 40.0
+        },
+        "logical_rect": {
+            "x": 10.0,
+            "y": 20.0,
+            "width": 30.0,
+            "height": 40.0
+        }
+    }
+}
diff --git a/tests/src/primitive_geometries.rs b/tests/src/primitive_geometries.rs
index c530885d2..c544f43df 100644
--- a/tests/src/primitive_geometries.rs
+++ b/tests/src/primitive_geometries.rs
@@ -89,7 +89,11 @@ impl Element {
         }
     }
 
-    fn from_rectangles(id: &str, ink_rect: cairo::Rectangle, logical_rect: cairo::Rectangle) -> Element {
+    fn from_rectangles(
+        id: &str,
+        ink_rect: cairo::Rectangle,
+        logical_rect: cairo::Rectangle,
+    ) -> Element {
         Element {
             id: String::from(id),
             ink_rect: Some(ink_rect.into()),
@@ -158,3 +162,11 @@ fn rect_stroke_unfilled() {
         "tests/fixtures/primitive_geometries/rect_stroke_unfilled.svg.geom",
     );
 }
+
+#[test]
+fn rect_isolate() {
+    test(
+        "tests/fixtures/primitive_geometries/rect_isolate.svg",
+        "tests/fixtures/primitive_geometries/rect_isolate.svg.geom",
+    );
+}


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