Skip to content

Commit 5cbef9d

Browse files
committed
Test chaining of !before/!after
RT#125575: https://rt.perl.org/Ticket/Display.html?id=125575 Includes fudges for mixed combinations, pending resolution of R#1304: rakudo/rakudo#1304
1 parent ca6de72 commit 5cbef9d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

S03-metaops/not.t

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 46;
4+
plan 47;
55

66
=begin pod
77
@@ -71,4 +71,27 @@ is &infix:<![!%%]>(3,2), False, "Meta not can autogen (![!%%])";
7171
is infix:<!===>(1,2), True, "Meta not can autogen (!===) without &";
7272
is &[!===](1,2), True, "Meta not can autogen (!===) with &[]";
7373

74+
# RT #125575
75+
subtest 'chaining of !before/!after' => {
76+
plan 12;
77+
78+
is-deeply ("a" !after "b" !after "c"), True, '!after/!after (Str)';
79+
is-deeply ("a" !before "b" !before "c"), False, '!before/!before (Str)';
80+
81+
#?rakudo 4 skip 'Should this work? https://github.com/rakudo/rakudo/issues/1304'
82+
is-deeply ("a" !before "b" !after "c"), False, '!before/!after (Str) (1)';
83+
is-deeply ("a" !after "b" !before "c"), False, '!after/!before (Str) (1)';
84+
is-deeply ("c" !before "a" !after "b"), True, '!before/!after (Str) (2)';
85+
is-deeply ("a" !after "c" !before "b"), False, '!after/!before (Str) (2)';
86+
87+
is-deeply (1 !after 2 !after 3), True, '!after/!after (Int)';
88+
is-deeply (1 !before 2 !before 3), False, '!before/!before (Int)';
89+
90+
#?rakudo 4 skip 'Should this work? https://github.com/rakudo/rakudo/issues/1304'
91+
is-deeply (1 !before 2 !after 3), False, '!before/!after (Int) (1)';
92+
is-deeply (1 !after 2 !before 3), False, '!after/!before (Int) (1)';
93+
is-deeply (3 !before 1 !after 2), True, '!before/!after (Int) (2)';
94+
is-deeply (1 !after 3 !before 2), False, '!after/!before (Int) (2)';
95+
}
96+
7497
# vim: ft=perl6

0 commit comments

Comments
 (0)