From: afresh1 Date: Tue, 21 Feb 2023 02:20:35 +0000 (+0000) Subject: Remove conflict markers from perl tests X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2266fceeb92c0fed277a6107be3c6c0d1b7ea712;p=openbsd Remove conflict markers from perl tests This is upstream PR 28103 https://github.com/Perl/perl5/pull/20813 Requested by stsp@ for quality of life improvments for Game of Trees users. --- diff --git a/gnu/usr.bin/perl/t/comp/parser.t b/gnu/usr.bin/perl/t/comp/parser.t index 8f4a484756f..8bca6288498 100644 --- a/gnu/usr.bin/perl/t/comp/parser.t +++ b/gnu/usr.bin/perl/t/comp/parser.t @@ -572,16 +572,13 @@ eval 'qq{@{0]}${}},{})'; is(1, 1, "RT #124207"); # RT #127993 version control conflict markers +my @conflict_markers = map { $_ x 7 } qw( < = > ); " this should keep working -<<<<<<< +$conflict_markers[0] " =~ / ->>>>>>> +$conflict_markers[2] /; -for my $marker (qw( -<<<<<<< -======= ->>>>>>> -)) { +for my $marker (@conflict_markers) { eval "$marker"; like $@, qr/^Version control conflict marker at \(eval \d+\) line 1, near "$marker"/, "VCS marker '$marker' at beginning"; eval "\$_\n$marker"; diff --git a/gnu/usr.bin/perl/t/lib/croak/toke b/gnu/usr.bin/perl/t/lib/croak/toke index dd27874c9ad..b6d943dbde4 100644 --- a/gnu/usr.bin/perl/t/lib/croak/toke +++ b/gnu/usr.bin/perl/t/lib/croak/toke @@ -421,16 +421,17 @@ BEGIN <> EXPECT Illegal declaration of subroutine BEGIN at - line 1. ######## -# NAME multiple conflict markers -<<<<<<< yours:sample.txt +# NAME multiple conflict markers. +# NOTE the >>>>>> theirs:sample.txt +>CONFLICT> theirs:sample.txt EXPECT -Version control conflict marker at - line 1, near "<<<<<<<" -Version control conflict marker at - line 3, near "=======" -Version control conflict marker at - line 5, near ">>>>>>>" +Version control conflict marker at - line 1, near "CONFLICT>" Execution of - aborted due to compilation errors. ######## # NAME (Might be a runaway multi-line...) with Latin-1 delimiters in utf8 diff --git a/gnu/usr.bin/perl/t/test.pl b/gnu/usr.bin/perl/t/test.pl index d92f28f8f22..d92b212222a 100644 --- a/gnu/usr.bin/perl/t/test.pl +++ b/gnu/usr.bin/perl/t/test.pl @@ -1311,6 +1311,14 @@ sub run_multiple_progs { if (s/^(\s*-\w+)//) { $switch = $1; } + + s/^# NOTE.*\n//mg; # remove any NOTE comments in the content + + # unhide conflict markers - we hide them so that naive + # conflict marker detection logic doesn't get upset with our + # tests. + s/([<=>])CONFLICT\1/$1 x 7/ge; + my ($prog, $expected) = split(/\nEXPECT(?:\n|$)/, $_, 2); my %reason;