[librsvg/rustify-rsvg-convert: 14/14] tests: use trim() on the EndsWithPredicate




commit 7028bdeb82275b9985cd184295165076a10a2f63
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 6dc83541..9b07f41c 100644
--- a/tests/src/cmdline/rsvg_convert.rs
+++ b/tests/src/cmdline/rsvg_convert.rs
@@ -175,11 +175,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]
@@ -651,10 +651,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]