@@ -13,7 +13,7 @@ proper separation of the two levels.
13
13
14
14
= end pod
15
15
16
- plan 65 ;
16
+ plan 69 ;
17
17
18
18
19
19
# terms
@@ -81,10 +81,10 @@ ok(?(!(1 & 2 ^ 4) != 3), "blah blah blah");
81
81
82
82
{ # test that | and ^ are on the same level but parsefail
83
83
throws-like ' my Mu $a = (1 | 2 ^ 3)' ,
84
- X::Syntax::NonAssociative ,
84
+ X::Syntax::NonListAssociative ,
85
85
' | and ^ may not associate' ;
86
86
throws-like ' my Mu $a = (1 ^ 2 | 3)' ,
87
- X::Syntax::NonAssociative ,
87
+ X::Syntax::NonListAssociative ,
88
88
' ^ and | may not associate' ;
89
89
};
90
90
@@ -99,6 +99,18 @@ ok(?(!(1 & 2 ^ 4) != 3), "blah blah blah");
99
99
100
100
ok (0 < 2 <= > 1 < 2 , " 0 < 2 <=> 1 < 2 means 0 < 1 < 2" );
101
101
102
+ # structural infix
103
+
104
+ is (1 | 3 <= > 2 ). gist , ' any(Less, More)' , ' <=> binds looser than |' ;
105
+ is (1 == 3 <= > 2 ). gist , ' True' , ' <=> binds tighter than ==' ;
106
+ throws-like ' 1 .. 2 .. 3' ,
107
+ X::Syntax::NonAssociative ,
108
+ ' identical .. is not associative' ;
109
+ throws-like ' 1 <=> 2 leg 3' ,
110
+ X::Syntax::NonAssociative ,
111
+ ' <=> and leg are not associative' ;
112
+
113
+
102
114
# chaining
103
115
104
116
is ((0 != 1 && " foo" ), " foo" , " != binds tighter than &&" );
@@ -164,10 +176,10 @@ is(((not 1,42)[1]), 42, "not is tighter than comma");
164
176
# RT #77848
165
177
{
166
178
throws-like ' 4 X+> 1...2' ,
167
- X::Syntax::NonAssociative ,
179
+ X::Syntax::NonListAssociative ,
168
180
' X+> must not associate with ...' ;
169
181
throws-like q [ '08:12:23'.split(':') Z* 60 X** reverse ^3 ] ,
170
- X::Syntax::NonAssociative ,
182
+ X::Syntax::NonListAssociative ,
171
183
' Z* and X** are non associative' ;
172
184
}
173
185
@@ -221,7 +233,7 @@ ok ((1 => 2 => 3).value ~~ Pair), '=> is right-assoc (2)';
221
233
# L<S03/Operator precedence/only works between identical operators>
222
234
223
235
throws-like ' 1, 2 Z 3, 4 X 5, 6' ,
224
- X::Syntax::NonAssociative ,
236
+ X::Syntax::NonListAssociative ,
225
237
' list associativity only works between identical operators' ;
226
238
227
239
# ?niecza skip 'assigning to readonly value'
0 commit comments