[librsvg: 4/14] New test to ensure an output PDF has textual content




commit dbafb2e4ebc6ba294a7d5b2bc76016754ec977c7
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Mar 8 17:25:27 2022 -0600

    New test to ensure an output PDF has textual content
    
    ... as opposed to all text rendered as paths.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/673>

 tests/src/cmdline/rsvg_convert.rs | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/tests/src/cmdline/rsvg_convert.rs b/tests/src/cmdline/rsvg_convert.rs
index c3ade9f6f..f5c85c854 100644
--- a/tests/src/cmdline/rsvg_convert.rs
+++ b/tests/src/cmdline/rsvg_convert.rs
@@ -411,6 +411,22 @@ fn pdf_has_link_inside_text() {
         );
 }
 
+#[cfg(system_deps_have_cairo_pdf)]
+#[test]
+fn pdf_has_text() {
+    let input = Path::new("tests/fixtures/text/hello-world.svg");
+    RsvgConvert::new()
+        .arg("--format=pdf")
+        .arg(input)
+        .assert()
+        .success()
+        .stdout(
+            file::is_pdf()
+                .with_text("Hello world!")
+                .and(file::is_pdf().with_text("Hello again!")),
+        );
+}
+
 #[cfg(system_deps_have_cairo_pdf)]
 #[test]
 fn env_source_data_epoch_controls_pdf_creation_date() {


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