[librsvg/rustify-rsvg-convert: 13/41] tests: Adjust test for size overflow




commit e5e0b8ca67d3583322b5444a93176f110c49b065
Author: Sven Neumann <sven svenfoo org>
Date:   Tue Nov 17 14:41:21 2020 +0100

    tests: Adjust test for size overflow
    
    This SVG used to result in the error message "Could not get dimensions",
    but the actual issue with that SVG is that rendering would overflow the
    image surface limits of cairo, which is better described by the error
    message that rsvg-convert yields now.

 tests/src/cmdline/rsvg_convert.rs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/tests/src/cmdline/rsvg_convert.rs b/tests/src/cmdline/rsvg_convert.rs
index 1e1396c1..6dc83541 100644
--- a/tests/src/cmdline/rsvg_convert.rs
+++ b/tests/src/cmdline/rsvg_convert.rs
@@ -407,13 +407,13 @@ fn y_short_option() {
 
 #[test]
 fn huge_zoom_factor_yields_error() {
-    let starts_with = starts_with("The resulting image would be larger than 32767 pixels");
-    let ends_with = ends_with("Please specify a smaller size.");
     RsvgConvert::new_with_input("tests/fixtures/dimensions/521-with-viewbox.svg")
         .arg("--zoom=1000")
         .assert()
         .failure()
-        .stderr(starts_with.and(ends_with).trim());
+        .stderr(starts_with(
+            "The resulting image would be larger than 32767 pixels",
+        ));
 }
 
 #[test]
@@ -636,7 +636,9 @@ fn overflowing_size_is_detected() {
     RsvgConvert::new_with_input("tests/fixtures/render-crash/591-vbox-overflow.svg")
         .assert()
         .failure()
-        .stderr(contains("Could not get dimensions").trim());
+        .stderr(starts_with(
+            "The resulting image would be larger than 32767 pixels",
+        ));
 }
 
 #[test]


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