[librsvg: 7/8] rsvg-convert: Tests for invalid zoom factors
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 7/8] rsvg-convert: Tests for invalid zoom factors
- Date: Wed, 7 Jul 2021 23:20:26 +0000 (UTC)
commit 4af59406ebe15a1e82448f80488694b0c0744e4b
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Jul 7 17:29:57 2021 -0500
rsvg-convert: Tests for invalid zoom factors
tests/src/cmdline/rsvg_convert.rs | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
---
diff --git a/tests/src/cmdline/rsvg_convert.rs b/tests/src/cmdline/rsvg_convert.rs
index 726b20ef..f23b3f02 100644
--- a/tests/src/cmdline/rsvg_convert.rs
+++ b/tests/src/cmdline/rsvg_convert.rs
@@ -471,6 +471,24 @@ fn huge_zoom_factor_yields_error() {
));
}
+#[test]
+fn negative_zoom_factor_yields_error() {
+ RsvgConvert::new_with_input("tests/fixtures/dimensions/521-with-viewbox.svg")
+ .arg("--zoom=-2")
+ .assert()
+ .failure()
+ .stderr(contains("Invalid zoom"));
+}
+
+#[test]
+fn invalid_zoom_factor_yields_error() {
+ RsvgConvert::new_with_input("tests/fixtures/dimensions/521-with-viewbox.svg")
+ .arg("--zoom=foo")
+ .assert()
+ .failure()
+ .stderr(contains("Invalid value"));
+}
+
#[test]
fn default_resolution_is_96dpi() {
RsvgConvert::new_with_input("tests/fixtures/api/dpi.svg")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]