Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 320 lines (278 sloc) 12.339 kb
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
1 use v6;
2 use Test;
e122112 [t/spec] fix reduce-metaop.t, moritz--
moritz authored
3
e9cdf15 @felliott add tests for RT #65164 (chained-xor reduce: [^^])
felliott authored
4 plan 148;
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
5
6 =begin pod
7
8 =head1 DESCRIPTION
9
10 This test tests the C<[...]> reduce metaoperator.
11
12 Reference:
13 L<"http://groups.google.de/group/perl.perl6.language/msg/bd9eb275d5da2eda">
14
15 =end pod
16
17 # L<S03/"Reduction operators">
18
19 # [...] reduce metaoperator
20 {
21 my @array = <5 -3 7 0 1 -9>;
22 my $sum = 5 + -3 + 7 + 0 + 1 + -9; # laziness :)
23
24 is(([+] @array), $sum, "[+] works");
25 is(([*] 1,2,3), (1*2*3), "[*] works");
26 is(([-] 1,2,3), (1-2-3), "[-] works");
27 is(([/] 12,4,3), (12/4/3), "[/] works");
9b6c25a [t/spec] Add simple tests for [div] and [mod].
colomon authored
28 is(([div] 12,4,3), (12 div 4 div 3), "[div] works");
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
29 is(([**] 2,2,3), (2**2**3), "[**] works");
5d1999e [t/spec] a test for [%] (meta reduce modulo)
moritz authored
30 is(([%] 13,7,4), (13%7%4), "[%] works");
9b6c25a [t/spec] Add simple tests for [div] and [mod].
colomon authored
31 is(([mod] 13,7,4), (13 mod 7 mod 4), "[mod] works");
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
32
33 is((~ [\+] @array), "5 2 9 9 10 1", "[\\+] works");
34 is((~ [\-] 1, 2, 3), "1 -1 -4", "[\\-] works");
35 }
36
37 {
38 is ([~] <a b c d>), "abcd", "[~] works";
39 is (~ [\~] <a b c d>), "a ab abc abcd", "[\\~] works";
40 }
41
42 {
ea847c7 @moritz remove more wrong uses of True and False as 0 and 1 (still more left); m...
moritz authored
43 ok ([<] 1, 2, 3, 4), "[<] works (1)";
44 nok ([<] 1, 3, 2, 4), "[<] works (2)";
45 ok ([>] 4, 3, 2, 1), "[>] works (1)";
46 nok ([>] 4, 2, 3, 1), "[>] works (2)";
47 ok ([==] 4, 4, 4), "[==] works (1)";
48 nok ([==] 4, 5, 4), "[==] works (2)";
49 ok ([!=] 4, 5, 6), "[!=] works (1)";
50 nok ([!=] 4, 4, 4), "[!=] works (2)";
e7dbb23 [t/spec] Refudge S03-metaops/reduce.t a bit so that it works again.
colomon authored
51 }
d1ccd8b [t/spec] tests for === and =:= and their negated forms inside meta ops
moritz authored
52
e7dbb23 [t/spec] Refudge S03-metaops/reduce.t a bit so that it works again.
colomon authored
53 {
e75736f [t/spec] tests for [eq], [ne]
moritz authored
54 ok (! [eq] <a a b a>), '[eq] basic sanity (positive)';
55 ok ( [eq] <a a a a>), '[eq] basic sanity (negative)';
56 ok ( [ne] <a b c a>), '[ne] basic sanity (positive)';
57 ok (! [ne] <a a b c>), '[ne] basic sanity (negative)';
58 ok ( [lt] <a b c e>), '[lt] basic sanity (positive)';
59 ok (! [lt] <a a c e>), '[lt] basic sanity (negative)';
e7dbb23 [t/spec] Refudge S03-metaops/reduce.t a bit so that it works again.
colomon authored
60 }
e75736f [t/spec] tests for [eq], [ne]
moritz authored
61
e7dbb23 [t/spec] Refudge S03-metaops/reduce.t a bit so that it works again.
colomon authored
62 #?rakudo skip "=:= NYI"
63 {
d1ccd8b [t/spec] tests for === and =:= and their negated forms inside meta ops
moritz authored
64 my ($x, $y);
65 ok ( [=:=] $x, $x, $x), '[=:=] basic sanity 1';
66 ok (not [=:=] $x, $y, $x), '[=:=] basic sanity 2';
67 ok ( [!=:=] $x, $y, $x), '[!=:=] basic sanity (positive)';
68 ok (not [!=:=] $y, $y, $x), '[!=:=] basic sanity (negative)';
69 $y := $x;
70 ok ( [=:=] $y, $x, $y), '[=:=] after binding';
e7dbb23 [t/spec] Refudge S03-metaops/reduce.t a bit so that it works again.
colomon authored
71 }
d1ccd8b [t/spec] tests for === and =:= and their negated forms inside meta ops
moritz authored
72
e7dbb23 [t/spec] Refudge S03-metaops/reduce.t a bit so that it works again.
colomon authored
73 {
d1ccd8b [t/spec] tests for === and =:= and their negated forms inside meta ops
moritz authored
74 my $a = [1, 2];
75 my $b = [1, 2];
76
ea847c7 @moritz remove more wrong uses of True and False as 0 and 1 (still more left); m...
moritz authored
77 ok ([===] 1, 1, 1, 1), '[===] with literals';
78 ok ([===] $a, $a, $a), '[===] with vars (positive)';
79 nok ([===] $a, $a, [1, 2]), '[===] with vars (negative)';
80 ok ([!===] $a, $b, $a), '[!===] basic sanity (positive)';
81 nok ([!===] $a, $b, $b), '[!===] basic sanity (negative)';
434eb4e [t/spec] Unfudge tests for reduction meta-operator with chaining comparr...
jnthn authored
82 }
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
83
434eb4e [t/spec] Unfudge tests for reduction meta-operator with chaining comparr...
jnthn authored
84 {
29b04a9 @moritz fix tests for Bool stringification
moritz authored
85 is ~ ([\<] 1, 2, 3, 4).map({+$_}), "1 1 1 1", "[\\<] works (1)";
86 is ~ ([\<] 1, 3, 2, 4).map({+$_}), "1 1 0 0", "[\\<] works (2)";
87 is ~ ([\>] 4, 3, 2, 1).map({+$_}), "1 1 1 1", "[\\>] works (1)";
88 is ~ ([\>] 4, 2, 3, 1).map({+$_}), "1 1 0 0", "[\\>] works (2)";
89 is ~ ([\==] 4, 4, 4).map({+$_}), "1 1 1", "[\\==] works (1)";
90 is ~ ([\==] 4, 5, 4).map({+$_}), "1 0 0", "[\\==] works (2)";
91 is ~ ([\!=] 4, 5, 6).map({+$_}), "1 1 1", "[\\!=] works (1)";
92 is ~ ([\!=] 4, 5, 5).map({+$_}), "1 1 0", "[\\!=] works (2)";
5cb1e9f [t/spec] Fix triangle form of reduce metaop tests.
bacek authored
93 is (~ [\**] 1, 2, 3), "3 8 1", "[\\**] (right assoc) works (1)";
94 is (~ [\**] 3, 2, 0), "0 1 3", "[\\**] (right assoc) works (2)";
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
95 }
96
97 {
8f9a119 [t/] unify compartmentalized undef and Object concepts into Mu
lwall authored
98 my @array = (Mu, Mu, 3, Mu, 5);
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
99 is ([//] @array), 3, "[//] works";
4acefb9 [t/spec] unfudge [//] and [||] tests for rakudo
moritz authored
100 #?rakudo skip '[orelse]'
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
101 is ([orelse] @array), 3, "[orelse] works";
102 }
103
104 {
8f9a119 [t/] unify compartmentalized undef and Object concepts into Mu
lwall authored
105 my @array = (Mu, Mu, 0, 3, Mu, 5);
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
106 is ([||] @array), 3, "[||] works";
107 is ([or] @array), 3, "[or] works";
108
8f9a119 [t/] unify compartmentalized undef and Object concepts into Mu
lwall authored
109 # Mu as well as [//] should work too, but testing it like
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
110 # this would presumably emit warnings when we have them.
111 is (~ [\||] 0, 0, 3, 4, 5), "0 0 3 3 3", "[\\||] works";
112 }
113
fc7413f [t/spec] Tests for [&&] and [and]. Patch courtesy of (Alex Kapranoff)++.
jnthn authored
114 {
115 my @array = (Mu, Mu, 0, 3, Mu, 5);
116 my @array1 = (2, 3, 4);
117 nok ([&&] @array), "[&&] works with 1 false";
118 is ([&&] @array1), 4, "[&&] works";
119 nok ([and] @array), "[and] works with 1 false";
120 is ([and] @array1), 4, "[and] works";
121 }
122
bc058f2 [STD] improve parsing of reduceops
lwall authored
123 # not currently legal without an infix subscript operator
124 # {
125 # my $hash = {a => {b => {c => {d => 42, e => 23}}}};
126 # is try { [.{}] $hash, <a b c d> }, 42, '[.{}] works';
127 # }
128 #
129 # {
130 # my $hash = {a => {b => 42}};
131 # is ([.{}] $hash, <a b>), 42, '[.{}] works two levels deep';
132 # }
133 #
134 # {
135 # my $arr = [[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]];
136 # is ([.[]] $arr, 1, 0, 2), 9, '[.[]] works';
137 # }
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
138
139 {
140 # 18:45 < autrijus> hm, I found a way to easily do linked list consing in Perl6
141 # 18:45 < autrijus> [=>] 1..10;
142 my $list = [=>] 1,2,3;
ed68273 [t/spec] remove usage of try as a function
moritz authored
143 is $list.key, 1, "[=>] works (1)";
144 is (try {$list.value.key}), 2, "[=>] works (2)";
145 is (try {$list.value.value}), 3, "[=>] works (3)";
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
146 }
147
148 {
21768a7 [t/spec] clean up and fudge reduce-metaop.t for rakudo.
moritz authored
149 my @array = <5 -3 7 0 1 -9>;
150 # according to http://irclog.perlgeek.de/perl6/2008-09-10#i_560910
151 # [,] returns a scalar (holding an Array)
152 my $count = 0;
153 $count++ for [,] @array;
154 is $count, 1, '[,] returns a single Array';
a246cb9 [t/spec] correct a test for [,], and unfudge a few for rakudo
moritz authored
155 ok ([,] @array) ~~ Positional, '[,] returns something Positional';
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
156 }
157
158 # Following two tests taken verbatim from former t/operators/reduce.t
159 lives_ok({my @foo = [1..3] >>+<< [1..3] >>+<< [1..3]},'Sanity Check');
160 lives_ok({my @foo = [>>+<<] ([1..3],[1..3],[1..3])},'Parse [>>+<<]');
161
162 # Check that user defined infix ops work with [...], too.
21768a7 [t/spec] clean up and fudge reduce-metaop.t for rakudo.
moritz authored
163 #?pugs todo 'bug'
8de8af6 [t/spec] partially fudge reduce.t for rakudo
moritz authored
164 #?rakudo skip 'reduce of user defined op'
21768a7 [t/spec] clean up and fudge reduce-metaop.t for rakudo.
moritz authored
165 {
166 sub infix:<more_than_plus>(Int $a, Int $b) { $a + $b + 1 }
d1ccd8b [t/spec] tests for === and =:= and their negated forms inside meta ops
moritz authored
167 is (try { [more_than_plus] 1, 2, 3 }), 8, "[...] reduce metaop works on user defined ops";
21768a7 [t/spec] clean up and fudge reduce-metaop.t for rakudo.
moritz authored
168 }
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
169
f148336 [STD vs t] user-defined prefix, infix, and postfix ops now derive new la...
lwall authored
170 # {
171 # my $arr = [ 42, [ 23 ] ];
172 # $arr[1][1] = $arr;
173 #
174 # is try { [.[]] $arr, 1, 1, 1, 1, 1, 0 }, 23, '[.[]] works with infinite data structures';
175 # }
176 #
177 # {
178 # my $hash = {a => {b => 42}};
179 # $hash<a><c> = $hash;
180 #
181 # is try { [.{}] $hash, <a c a c a b> }, 42, '[.{}] works with infinite data structures';
182 # }
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
183
184 # L<S03/"Reduction operators"/"Among the builtin operators, [+]() returns 0 and [*]() returns 1">
185
21768a7 [t/spec] clean up and fudge reduce-metaop.t for rakudo.
moritz authored
186 is( ([*]()), 1, "[*]() returns 1");
187 is( ([+]()), 0, "[+]() returns 0");
932a1bc [gsoc_spectest] reorganization of reduce tests
Auzon authored
188
2d7d862 [t/spec] Add a few tests for the one-argument case.
colomon authored
189 is( ([*] 41), 41, "[*] 41 returns 41");
190 is( ([*] 42), 42, "[*] 42 returns 42");
0e61dff [t/spec] Add a few more tests for the one-argument case.
colomon authored
191 is( ~([\*] 42), "42", "[\*] 42 returns (42)");
2d7d862 [t/spec] Add a few tests for the one-argument case.
colomon authored
192 is( ([~] 'towel'), 'towel', "[~] 'towel' returns 'towel'");
193 is( ([~] 'washcloth'), 'washcloth', "[~] 'washcloth' returns 'washcloth'");
0e61dff [t/spec] Add a few more tests for the one-argument case.
colomon authored
194 is( ([\~] 'towel'), 'towel', "[\~] 'towel' returns 'towel'");
f9ed5f4 [reduce.t] fix parsefail
lwall authored
195 ok( ([\~] 'towel') ~~ Iterable, "[\~] 'towel' returns something Iterable");
2d7d862 [t/spec] Add a few tests for the one-argument case.
colomon authored
196 is( ([<] 42), Bool::True, "[<] 42 returns true");
ea847c7 @moritz remove more wrong uses of True and False as 0 and 1 (still more left); m...
moritz authored
197 is( ~([\<] 42), ~True, "[\<] 42 returns '1'");
0e61dff [t/spec] Add a few more tests for the one-argument case.
colomon authored
198 ok( ([\<] 42) ~~ Iterable, "[\<] 42 returns something Iterable");
2d7d862 [t/spec] Add a few tests for the one-argument case.
colomon authored
199
9e9686f [t/spec] replace .batch($x) with .[^$x]
moritz authored
200 is( ([\*] 1..*).[^10].join(', '), '1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800',
09a80e6 [t/spec] Add two tests for lazy triangle reduce.
colomon authored
201 'triangle reduce is lazy');
9e9686f [t/spec] replace .batch($x) with .[^$x]
moritz authored
202 is( ([\R~] 'a'..*).[^8].join(', '), 'a, ba, cba, dcba, edcba, fedcba, gfedcba, hgfedcba',
09a80e6 [t/spec] Add two tests for lazy triangle reduce.
colomon authored
203 'triangle reduce is lazy');
204
f80ef63 [t/spec] Tests for RT #65164
kyle authored
205 # RT #65164 (TODO: implement [^^])
206 #?rakudo skip 'implement [^^]'
207 {
de5c0ff [reduce.t] Edited [^^] tests so RT #77442 isn't a prerequisite.
Kodi Arfer authored
208 is ([^^] 0, 42), 42, '[^^] works (one of two true)';
209 is ([^^] 42, 0), 42, '[^^] works (one of two true)';
210 ok ! ([^^] 1, 42), '[^^] works (two true)';
211 ok ! ([^^] 0, 0), '[^^] works (two false)';
f80ef63 [t/spec] Tests for RT #65164
kyle authored
212
de5c0ff [reduce.t] Edited [^^] tests so RT #77442 isn't a prerequisite.
Kodi Arfer authored
213 ok ! ([^^] 0, 0, 0), '[^^] works (three false)';
214 ok ! ([^^] 5, 9, 17), '[^^] works (three true)';
f80ef63 [t/spec] Tests for RT #65164
kyle authored
215
de5c0ff [reduce.t] Edited [^^] tests so RT #77442 isn't a prerequisite.
Kodi Arfer authored
216 is ([^^] 5, 9, 0), (5 ^^ 9 ^^ 0), '[^^] mix 1';
217 is ([^^] 5, 0, 17), (5 ^^ 0 ^^ 17), '[^^] mix 2';
218 is ([^^] 0, 9, 17), (0 ^^ 9 ^^ 17), '[^^] mix 3';
219 is ([^^] 5, 0, 0), (5 ^^ 0 ^^ 0), '[^^] mix 4';
220 is ([^^] 0, 9, 0), (0 ^^ 9 ^^ 0), '[^^] mix 5';
221 is ([^^] 0, 0, 17), (0 ^^ 0 ^^ 17), '[^^] mix 6';
e9cdf15 @felliott add tests for RT #65164 (chained-xor reduce: [^^])
felliott authored
222
223 # test False / undefined things
224 my $msg1 = 'reduce [^^] false variable test';
225 my $msg2 = 'infix ^^ false variable test';
226 for (0, '0', '', Bool::False, Any, Mu, Nil) -> $undef {
de5c0ff [reduce.t] Edited [^^] tests so RT #77442 isn't a prerequisite.
Kodi Arfer authored
227 ok ( [^^] $undef, $undef, $undef, 5 ), "|{$undef.perl}| $msg1 \#1";
228 nok ( [^^] 1, 2, $undef, 3, $undef ), "|{$undef.perl}| $msg1 \#2";
229 nok ( [^^] $undef, $undef, 1, 5 ), "|{$undef.perl}| $msg1 \#3";
230 nok ( [^^] 1, $undef, $undef, 5 ), "|{$undef.perl}| $msg1 \#4";
231 ok ( [^^] $undef, $undef, 2, $undef ), "|{$undef.perl}| $msg1 \#5";
232 nok ( [^^] $undef, $undef, $undef ), "|{$undef.perl}| $msg1 \#6";
233 nok ( [^^] $undef, $undef ), "|{$undef.perl}| $msg1 \#7";
234 ok ( [^^] $undef, 1 ), "|{$undef.perl}| $msg1 \#8";
235 ok ( [^^] 1, $undef ), "|{$undef.perl}| $msg1 \#9";
236 nok ( [^^] $undef ), "|{$undef.perl}| $msg1 \#10";
e9cdf15 @felliott add tests for RT #65164 (chained-xor reduce: [^^])
felliott authored
237 ok ( $undef ^^ $undef ^^ $undef ^^ 5 ), "|{$undef.perl}| $msg2 \#1";
238 nok ( 1 ^^ 2 ^^ $undef ^^ 3 ^^ $undef ), "|{$undef.perl}| $msg2 \#2";
239 nok ( $undef ^^ $undef ^^ 1 ^^ 5 ), "|{$undef.perl}| $msg2 \#3";
240 nok ( 1 ^^ $undef ^^ $undef ^^ 5 ), "|{$undef.perl}| $msg2 \#4";
241 ok ( $undef ^^ $undef ^^ 2 ^^ $undef ), "|{$undef.perl}| $msg2 \#5";
242 nok ( $undef ^^ $undef ^^ $undef ), "|{$undef.perl}| $msg2 \#6";
243 nok ( $undef ^^ $undef ), "|{$undef.perl}| $msg2 \#7";
244 ok ( $undef ^^ 1 ), "|{$undef.perl}| $msg2 \#8";
245 ok ( 1 ^^ $undef ), "|{$undef.perl}| $msg2 \#9";
246 }
247
248 # test numericy true things
249 $msg1 = 'reduce [^^] true numbery variable test';
250 $msg2 = 'infix ^^ true numbery variable test';
251 for (1, -147, pi, Bool::True) -> $def {
de5c0ff [reduce.t] Edited [^^] tests so RT #77442 isn't a prerequisite.
Kodi Arfer authored
252 nok ( [^^] 0, 0, $def, 3, $def ), "|{$def.perl}| $msg1 \#1";
253 nok ( [^^] $def, $def, 0 ), "|{$def.perl}| $msg1 \#2";
254 nok ( [^^] 1, $def, Any, 5 ), "|{$def.perl}| $msg1 \#3";
255 ok ( [^^] $def, 0, 0, 0 ) == $def, "|{$def.perl}| $msg1 \#4";
256 ok ( [^^] Any, Any, Any, $def ) == $def, "|{$def.perl}| $msg1 \#5";
257 nok ( [^^] $def, $def ), "|{$def.perl}| $msg1 \#6";
258 ok ( [^^] $def, 0 ) == $def, "|{$def.perl}| $msg1 \#7";
259 ok ( [^^] 0, $def ) == $def, "|{$def.perl}| $msg1 \#8";
260 ok ( [^^] $def ), "|{$def.perl}| $msg1 \#9";
e9cdf15 @felliott add tests for RT #65164 (chained-xor reduce: [^^])
felliott authored
261 nok ( 0 ^^ 0 ^^ $def ^^ 3 ^^ $def ), "|{$def.perl}| $msg2 \#1";
262 nok ( $def ^^ $def ^^ 0 ), "|{$def.perl}| $msg2 \#2";
263 nok ( 1 ^^ $def ^^ Any ^^ 5 ), "|{$def.perl}| $msg2 \#3";
264 ok ( $def ^^ 0 ^^ 0 ^^ 0 ) == $def, "|{$def.perl}| $msg2 \#4";
265 ok ( Any ^^ Any ^^ Any ^^ $def ) == $def,"|{$def.perl}| $msg2 \#5";
266 nok ( $def ^^ $def ), "|{$def.perl}| $msg2 \#6";
267 ok ( $def ^^ 0 ) == $def, "|{$def.perl}| $msg2 \#7";
268 ok ( 0 ^^ $def ) == $def, "|{$def.perl}| $msg2 \#8";
269 }
270
271 # test stringy true things
272 $msg1 = 'reduce [^^] true string variable test';
273 $msg2 = 'infix ^^ true string variable test';
274 for ('no', 'Bob', '10', 'False') -> $def {
de5c0ff [reduce.t] Edited [^^] tests so RT #77442 isn't a prerequisite.
Kodi Arfer authored
275 nok ( [^^] $def, $def, $def, 'string' ), "|{$def.perl}| $msg1 \#1";
276 nok ( [^^] '', '', $def, 'str', $def ), "|{$def.perl}| $msg1 \#2";
277 nok ( [^^] $def, $def,'' ), "|{$def.perl}| $msg1 \#3";
278 nok ( [^^] 1, $def, Any, 5 ), "|{$def.perl}| $msg1 \#4";
279 ok ( [^^] $def, '', '', '' ) eq $def, "|{$def.perl}| $msg1 \#5";
280 ok ( [^^] Any, Any, Any, $def ) eq $def, "|{$def.perl}| $msg1 \#6";
281 nok ( [^^] $def, $def ), "|{$def.perl}| $msg1 \#7";
282 ok ( [^^] $def, '' ) eq $def, "|{$def.perl}| $msg1 \#8";
283 ok ( [^^] '', $def ) eq $def, "|{$def.perl}| $msg1 \#9";
284 ok ( [^^] $def ) eq $def, "|{$def.perl}| $msg1 \#10";
e9cdf15 @felliott add tests for RT #65164 (chained-xor reduce: [^^])
felliott authored
285 nok ( $def ^^ $def ^^ $def ^^ 'string' ), "|{$def.perl}| $msg2 \#1";
286 nok ( '' ^^ '' ^^ $def ^^ 'str' ^^ $def ),"|{$def.perl}| $msg2 \#2";
287 nok ( $def ^^ $def ^^'' ), "|{$def.perl}| $msg2 \#3";
288 nok ( 1 ^^ $def ^^ Any ^^ 5 ), "|{$def.perl}| $msg2 \#4";
289 ok ( $def ^^ '' ^^ '' ^^ '' ) eq $def, "|{$def.perl}| $msg2 \#5";
290 ok ( Any ^^ Any ^^ Any ^^ $def ) eq $def,"|{$def.perl}| $msg2 \#6";
291 nok ( $def ^^ $def ), "|{$def.perl}| $msg2 \#7";
292 ok ( $def ^^ '' ) eq $def, "|{$def.perl}| $msg2 \#8";
293 ok ( '' ^^ $def ) eq $def, "|{$def.perl}| $msg2 \#9";
294 }
295
f80ef63 [t/spec] Tests for RT #65164
kyle authored
296 }
297
65d1a8d [t/spec] tests for RT #75234, using a metaop in one class hides it from ...
moritz authored
298 # RT #75234
299 # rakudo had a problem where once-used meta operators weren't installed
300 # in a sufficiently global location, so using a meta operator in class once
301 # makes it unusable further on
302 {
303 class A {
304 method m { return [~] gather for ^3 {take 'a'} }
305 }
306 class B {
307 method n { return [~] gather for ^4 {take 'b'}}
308 }
309 is A.new.m, 'aaa', '[~] works in first class';
310 is B.new.n, 'bbbb', '[~] works in second class';
311 is ([~] 1, 2, 5), '125', '[~] works outside class';
312 }
313
c5240b2 @kyleha [reduce] Test for RT 82210: Misparse of metaop with immediate ()
kyleha authored
314 #?rakudo todo 'RT 82210'
315 ok [+](1..10) + 0 == ([+] 1..10) + 0,
316 'a listop with immediate () is a function call (RT 82210)';
317
e76dd4c @moritz s/done_testing/done/ as per recent S24 changes
moritz authored
318 done;
4acefb9 [t/spec] unfudge [//] and [||] tests for rakudo
moritz authored
319 # vim: ft=perl6
Something went wrong with that request. Please try again.