This is an automated email from the git hooks/post-receive script.

abe pushed a commit to branch master
in repository debsums.

commit 349a25d79fe5c286f436135fa64a522781563280
Author: Axel Beckert <a...@deuxchevaux.org>
Date:   Thu Mar 26 01:43:54 2015 +0100

    Test suite: factor out internal trailing line break check
---
 t/debsums.t | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/t/debsums.t b/t/debsums.t
index 4e1d599..d9ee365 100644
--- a/t/debsums.t
+++ b/t/debsums.t
@@ -86,8 +86,10 @@ done_testing();
 
 sub sort_lines {
     my $string = shift;
-    return join("\n", sort split("\n", $string)).
-        $string =~ m/\n\z/ ? "\n" : '';
+    return join("\n",
+                sort
+                split("\n", $string))
+        . trailing_line_break_if_present($string);
 }
 
 sub remove_failed {
@@ -95,7 +97,7 @@ sub remove_failed {
     return join("\n",
                 grep { !/FAILED/ }
                 split("\n", $string))
-        . ($string =~ m/\n\z/ ? "\n" : '');
+        . trailing_line_break_if_present($string);
 }
 
 sub failed_only {
@@ -103,10 +105,19 @@ sub failed_only {
     return join("\n",
                 grep { /FAILED/ && s/\s*FAILED// }
                 split("\n", $string))
-        . ($string =~ m/\n\z/ ? "\n" : '');
+        . trailing_line_break_if_present($string);
 }
 
 sub expected_rc {
     my $exit_code = shift;
     is(rc >> 8, $exit_code, "Exit code is $exit_code");
 }
+
+sub trailing_line_break_if_present {
+    my $string = shift;
+    if ($string =~ m/\n\z/) {
+        return "\n";
+    } else {
+        return '';
+    }
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/debsums.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to