From 245c8aa369cb723c456d415377ff5a5f49822104 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 18 Sep 2017 14:23:54 -0300 Subject: [PATCH] Bug 19335: Fix 00-merge-conflict-markers.t when dockerised This does not make sense, but fix a bug (why?) Without this patch, the tests failed on po files: [17:14:26] t/00-merge-conflict-markers.t .. Failed 1/1 subtests Test Summary Report ------------------- t/00-merge-conflict-markers.t (Wstat: 9 Tests: 0 Failed: 0) Non-zero wait status: 9 Parse errors: Bad plan. You planned 1 tests but ran 0. Result: FAIL Note that this is not related to bug 19227. if the ^>>>>>> and ^<<<<<< matches are done on the same line, the test fail As saw it failed on *-pref.po files misc/translator/po/kn-Knda-pref.po misc/translator/po/ja-Jpan-JP-pref.po misc/translator/po/nl-BE-pref.po misc/translator/po/sr-Cyrl-pref.po --- t/00-merge-conflict-markers.t | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/t/00-merge-conflict-markers.t b/t/00-merge-conflict-markers.t index 2cbe8cf344..86f7fa5f8c 100644 --- a/t/00-merge-conflict-markers.t +++ b/t/00-merge-conflict-markers.t @@ -38,14 +38,11 @@ find({ my $fh = IO::File->new($file, 'r'); my $marker_found = 0; - my $line = 0; - while (<$fh>) { - $line++; - if (/^<<<<<>>>>>/) { - # could check for ^=====, but that's often used in text files - $marker_found = 1; - last; - } + while (my $line = <$fh>) { + # could check for ^=====, but that's often used in text files + $marker_found++ if $line =~ m|^<<<<<<|; + $marker_found++ if $line =~ m|^>>>>>>|; + last if $marker_found; } close $fh; push @failures, $file if $marker_found; -- 2.11.0