[librsvg: 1/11] tests: use trim() on the EndsWithPredicate




commit ba1e607bc26c940d3a599705457406f576f365e8
Author: Sven Neumann <sven svenfoo org>
Date:   Tue Nov 17 15:01:50 2020 +0100

    tests: use trim() on the EndsWithPredicate
    
    trim() is used to strip the trailing newline, apply it on the check
    that looks at the end of the output.

 tests/src/cmdline/rsvg_convert.rs | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/tests/src/cmdline/rsvg_convert.rs b/tests/src/cmdline/rsvg_convert.rs
index 36a764eb..b9a51c78 100644
--- a/tests/src/cmdline/rsvg_convert.rs
+++ b/tests/src/cmdline/rsvg_convert.rs
@@ -183,11 +183,11 @@ fn output_file_short_option() {
 #[test]
 fn empty_input_yields_error() {
     let starts_with = starts_with("Error reading SVG");
-    let ends_with = ends_with("Input file is too short");
+    let ends_with = ends_with("Input file is too short").trim();
     RsvgConvert::new()
         .assert()
         .failure()
-        .stderr(starts_with.and(ends_with).trim());
+        .stderr(starts_with.and(ends_with));
 }
 
 #[test]
@@ -657,10 +657,8 @@ fn no_keep_image_data_option() {
     RsvgConvert::accepts_arg("--no-keep-image-data");
 }
 
-fn is_version_output() -> TrimPredicate<AndPredicate<StartsWithPredicate, EndsWithPredicate, str>> {
-    starts_with("rsvg-convert ")
-        .and(ends_with_pkg_version())
-        .trim()
+fn is_version_output() -> AndPredicate<StartsWithPredicate, TrimPredicate<EndsWithPredicate>, str> {
+    starts_with("rsvg-convert ").and(ends_with_pkg_version().trim())
 }
 
 #[test]


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