[librsvg: 19/35] Add tests for specifying the width/height of a PDF
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 19/35] Add tests for specifying the width/height of a PDF
- Date: Thu, 17 Jun 2021 19:31:38 +0000 (UTC)
commit 1bd97712355c616a29485a953ce5928f14c5f027
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jun 14 19:18:27 2021 -0500
Add tests for specifying the width/height of a PDF
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/547>
tests/src/cmdline/rsvg_convert.rs | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
---
diff --git a/tests/src/cmdline/rsvg_convert.rs b/tests/src/cmdline/rsvg_convert.rs
index b70af582..41b33acd 100644
--- a/tests/src/cmdline/rsvg_convert.rs
+++ b/tests/src/cmdline/rsvg_convert.rs
@@ -539,6 +539,31 @@ fn unscaled_pdf_size() {
.stdout(file::is_pdf().with_page_size(72.0, 72.0));
}
+#[cfg(system_deps_have_cairo_pdf)]
+#[test]
+fn pdf_size_width_height() {
+ RsvgConvert::new_with_input("tests/fixtures/cmdline/dimensions-in.svg")
+ .arg("--format=pdf")
+ .arg("--width=2in")
+ .arg("--height=3in")
+ .assert()
+ .success()
+ .stdout(file::is_pdf().with_page_size(144.0, 216.0));
+}
+
+#[cfg(system_deps_have_cairo_pdf)]
+#[test]
+fn pdf_size_width_height_proportional() {
+ RsvgConvert::new_with_input("tests/fixtures/cmdline/dimensions-in.svg")
+ .arg("--format=pdf")
+ .arg("--width=2in")
+ .arg("--height=3in")
+ .arg("--keep-aspect-ratio")
+ .assert()
+ .success()
+ .stdout(file::is_pdf().with_page_size(144.0, 144.0));
+}
+
#[test]
fn does_not_clip_partial_coverage_pixels() {
RsvgConvert::new_with_input("tests/fixtures/cmdline/677-partial-pixel.svg")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]