Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 406 lines (309 sloc) 12.398 kb
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
1 use v6;
2
3 use Test;
4
8d4ec02f »
2009-11-04 [t/spec] remove some junction tests that relied on internal methods; …
5 plan *;
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
6
7 =begin pod
8
9 Misc. Junction tests
10
11 =end pod
12
8d4ec02f »
2009-11-04 [t/spec] remove some junction tests that relied on internal methods; …
13 #?rakudo 2 skip 'Null PMC access in get_integer() (RT #64184)'
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
14 isa_ok any(6,7), junction;
15 is any(6,7).WHAT, junction, 'junction.WHAT works';
3f05e7ff »
2009-07-24 [t/spec] identifying a junction causes Null PMC
16
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
17 # avoid auto-threading on ok()
8f9a1198 »
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
18 sub jok(Mu $condition, $msg?) { ok ?($condition), $msg };
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
19
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
20 # L<S03/Junctive operators>
21 # L<S09/Junctions>
22 {
23
13cc9c44 »
2009-10-09 [t/spec] 71 typos in 32 files.
24 # initialize them all to empty strings
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
25 my $a = '';
26 my $b = '';
27 my $c = '';
28
29 # make sure they all match to an empty string
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
30 jok('' eq ($a & $b & $c), 'junction of ($a & $b & $c) matches an empty string');
31 jok('' eq all($a, $b, $c), 'junction of all($a, $b, $c) matches an empty string');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
32
33 # give $a a value
34 $a = 'a';
35
36 # make sure that at least one of them matches 'a'
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
37 jok('a' eq ($b | $c | $a), 'junction of ($b | $c | $a) matches at least one "a"');
38 jok('a' eq any($b, $c, $a), 'junction of any($b, $c, $a) matches at least one "a"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
39
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
40 jok('' eq ($b | $c | $a), 'junction of ($b | $c | $a) matches at least one empty string');
41 jok('' eq any($b, $c, $a), 'junction of any($b, $c, $a) matches at least one empty string');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
42
43 # make sure that ~only~ one of them matches 'a'
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
44 jok('a' eq ($b ^ $c ^ $a), 'junction of ($b ^ $c ^ $a) matches at ~only~ one "a"');
45 jok('a' eq one($b, $c, $a), 'junction of one($b, $c, $a) matches at ~only~ one "a"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
46
47 # give $b a value
48 $b = 'a';
49
50 # now this will fail
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
51 jok('a' ne ($b ^ $c ^ $a), 'junction of ($b ^ $c ^ $a) matches at more than one "a"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
52
53 # change $b and give $c a value
54 $b = 'b';
55 $c = 'c';
56
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
57 jok('a' eq ($b ^ $c ^ $a), 'junction of ($b ^ $c ^ $a) matches at ~only~ one "a"');
58 jok('b' eq ($a ^ $b ^ $c), 'junction of ($a ^ $b ^ $c) matches at ~only~ one "b"');
59 jok('c' eq ($c ^ $a ^ $b), 'junction of ($c ^ $a ^ $b) matches at ~only~ one "c"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
60
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
61 jok('a' eq ($b | $c | $a), 'junction of ($b | $c | $a) matches at least one "a"');
62 jok('b' eq ($a | $b | $c), 'junction of ($a | $b | $c) matches at least one "b"');
63 jok('c' eq ($c | $a | $b), 'junction of ($c | $a | $b) matches at least one "c"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
64
65 ok(not(('a' eq ($b | $c | $a)) === Bool::False), 'junctional comparison doesn not mistakenly return both true and false');
66 ok(not(('b' eq ($a | $b | $c)) === Bool::False), 'junctional comparison doesn not mistakenly return both true and false');
67 ok(not(('c' eq ($c | $a | $b)) === Bool::False), 'junctional comparison doesn not mistakenly return both true and false');
68
69 # test junction to junction
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
70 jok(('a' | 'b' | 'c') eq ($a & $b & $c), 'junction ("a" | "b" | "c") matches junction ($a & $b & $c)');
71 jok(('a' & 'b' & 'c') eq ($a | $b | $c), 'junction ("a" & "b" & "c") matches junction ($a | $b | $c)');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
72
73 # mix around variables and literals
74
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
75 jok(($a & 'b' & 'c') eq ('a' | $b | $c), 'junction ($a & "b" & "c") matches junction ("a" | $b | $c)');
76 jok(($a & 'b' & $c) eq ('a' | $b | 'c'), 'junction ($a & "b" & $c) matches junction ("a" | $b | "c")');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
77
78 }
79
80 # same tests, but with junctions as variables
81 {
13cc9c44 »
2009-10-09 [t/spec] 71 typos in 32 files.
82 # initialize them all to empty strings
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
83 my $a = '';
84 my $b = '';
85 my $c = '';
86
87 my $all_of_them = $a & $b & $c;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
88 jok('' eq $all_of_them, 'junction variable of ($a & $b & $c) matches and empty string');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
89
90 $a = 'a';
91
92 my $any_of_them = $b | $c | $a;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
93 jok('a' eq $any_of_them, 'junction variable of ($b | $c | $a) matches at least one "a"');
94 jok('' eq $any_of_them, 'junction variable of ($b | $c | $a) matches at least one empty string');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
95
96 my $one_of_them = $b ^ $c ^ $a;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
97 jok('a' eq $one_of_them, 'junction variable of ($b ^ $c ^ $a) matches at ~only~ one "a"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
98
99 $b = 'a';
100
101 {
102 my $one_of_them = $b ^ $c ^ $a;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
103 jok('a' ne $one_of_them, 'junction variable of ($b ^ $c ^ $a) matches at more than one "a"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
104 }
105
106 $b = 'b';
107 $c = 'c';
108
109 {
110 my $one_of_them = $b ^ $c ^ $a;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
111 jok('a' eq $one_of_them, 'junction of ($b ^ $c ^ $a) matches at ~only~ one "a"');
112 jok('b' eq $one_of_them, 'junction of ($a ^ $b ^ $c) matches at ~only~ one "b"');
113 jok('c' eq $one_of_them, 'junction of ($c ^ $a ^ $b) matches at ~only~ one "c"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
114 }
115
116 {
117 my $any_of_them = $b | $c | $a;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
118 jok('a' eq $any_of_them, 'junction of ($b | $c | $a) matches at least one "a"');
119 jok('b' eq $any_of_them, 'junction of ($a | $b | $c) matches at least one "b"');
120 jok('c' eq $any_of_them, 'junction of ($c | $a | $b) matches at least one "c"');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
121 }
122
123 }
124
125 {
126 my $j = 1 | 2;
127 $j = 5;
128 is($j, 5, 'reassignment of junction variable');
129 }
130
131 {
648ae66f »
2008-07-01 [spec] fudged S03-junctions/misc.t
132 my $j;
133 my $k;
134 my $l;
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
135
136 $j = 1|2;
8d4ec02f »
2009-11-04 [t/spec] remove some junction tests that relied on internal methods; …
137 #?rakudo 3 todo 'lower case junction type'
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
138 is(~WHAT($j), 'junction()', 'basic junction type reference test');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
139
140 $k=$j;
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
141 is(~WHAT($k), 'junction()', 'assignment preserves reference');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
142
143 # XXX does this next one make any sense?
144 $l=\$j;
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
145 is(~WHAT($l), 'junction()', 'hard reference to junction');
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
146 }
147
148
149 =begin description
150
151 Tests junction examples from Synopsis 03
152
153 j() is used to convert a junction to canonical string form, currently
154 just using .perl until a better approach presents itself.
155
156 =end description
157
eda6db14 »
2009-08-02 [t/spec] move smartlinks from POD to ordinary comments
158 # L<S03/Junctive operators>
159
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
160 # Canonical stringification of a junction
8f9a1198 »
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
161 sub j (Mu $j) { return $j.perl }
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
162
163 {
164 # L<S03/Junctive operators/They thread through operations>
648ae66f »
2008-07-01 [spec] fudged S03-junctions/misc.t
165 my $got;
166 my $want;
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
167 $got = ((1|2|3)+4);
168 $want = (5|6|7);
169 is( j($got), j($want), 'thread + returning junctive result');
170
171 $got = ((1|2) + (3&4));
172 $want = ((4|5) & (5|6));
173 is( j($got), j($want), 'thread + returning junctive combination of results');
174
175 # L<S03/Junctive operators/This opens doors for constructions like>
176 # unless $roll == any(1..6) { print "Invalid roll" }
648ae66f »
2008-07-01 [spec] fudged S03-junctions/misc.t
177 my $roll;
178 my $note;
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
179 $roll = 3; $note = '';
180 unless $roll == any(1..6) { $note = "Invalid roll"; };
181 is($note, "", 'any() junction threading ==');
182
183 $roll = 7; $note = '';
184 unless $roll == any(1..6) { $note = "Invalid roll"; };
185 is($note, "Invalid roll", 'any() junction threading ==');
186
187 # if $roll == 1|2|3 { print "Low roll" }
188 $roll = 4; $note = '';
189 if $roll == 1|2|3 { $note = "Low roll" }
190 is($note, "", '| junction threading ==');
191
192 $roll = 2; $note = '';
193 if $roll == 1|2|3 { $note = "Low roll" }
194 is($note, "Low roll", '| junction threading ==');
d0da2231 »
2008-11-13 [spec]: Unfudge some junction tests for Rakudo.
195 }
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
196
d0da2231 »
2008-11-13 [spec]: Unfudge some junction tests for Rakudo.
197 #?rakudo skip 'Junctions as subscripts'
198 {
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
199 # L<S03/Junctive operators/Junctions work through subscripting>
648ae66f »
2008-07-01 [spec] fudged S03-junctions/misc.t
200 my $got;
201 my @foo;
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
202 $got = ''; @foo = ();
203 $got ~= 'y' if try { @foo[any(1,2,3)] };
204 is($got, '', "junctions work through subscripting, 0 matches");
205
206 $got = ''; @foo = (0,1);
207 $got ~= 'y' if try { @foo[any(1,2,3)] };
208 is($got, '', "junctions work through subscripting, 1 match");
209
210 $got = ''; @foo = (1,1,1);
211 $got ~= 'y' if try { @foo[any(1,2,3)] };
212 is($got, '', "junctions work through subscripting, 3 matches");
213
214
215 # L<S03/Junctive operators/Junctions are specifically unordered>
216 # Compiler *can* reorder and parallelize but *may not* so don't test
217 # for all(@foo) {...};
218
219 # Not sure what is expected
220 #my %got = ('1' => 1); # Hashes are unordered too
221 #@foo = (2,3,4);
222 #for all(@foo) { %got{$_} = 1; };
223 #is( %got.keys.sort.join(','), '1,2,3,4',
224 # 'for all(...) { ...} as parallelizable');
225 }
226
227 =begin description
228
229 These are implemented but still awaiting clarification on p6l.
230
231 On Fri, 2005-02-11 at 10:46 +1100, Damian Conway wrote:
232 > Subject: Re: Fwd: Junctive puzzles.
233 >
234 > Junctions have an associated boolean predicate that's preserved across
235 > operations on the junction. Junctions also implicitly distribute across
236 > operations, and rejunctify the results.
237
238 =end description
239
eda6db14 »
2009-08-02 [t/spec] move smartlinks from POD to ordinary comments
240 # L<S03/Junctive operators/They thread through operations>
241
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
242 {
243 my @subs = (sub {3}, sub {2});
244
648ae66f »
2008-07-01 [spec] fudged S03-junctions/misc.t
245 my $got;
246 my $want;
82ba44c6 »
2008-07-01 [spec] started to move junction tests (and upate POD). Much more work…
247
248 is(j(any(@subs)()), j(3|2), '.() on any() junction of subs');
249
250 $want = (3&2);
251 $got = all(@subs)();
252 is(j($got), j($want), '.() on all() junction of subs');
253
254 $want = (3^2);
255 $got = one(@subs)();
256 is(j($got), j($want), '.() on one() junction of subs');
257
258 $want = none(3,2);
259 $got = none(@subs)();
260 is(j($got), j($want), '.() on none() junction of subs');
261
262 $want = one( any(3,2), all(3,2) );
263 $got = one( any(@subs), all(@subs) )();
264 is(j($got), j($want), '.() on complex junction of subs');
265
266 # Avoid future constant folding
267 #my $rand = rand;
268 #my $zero = int($rand-$rand);
269 #my @subs = (sub {3+$zero}, sub {2+$zero});
270 }
271
272 # Check functional and operator versions produce the same structure
273 {
274 is(j((1|2)^(3&4)), j(one(any(1,2),all(3,4))),
275 '((1|2)^(3&4)) equiv to one(any(1,2),all(3,4))');
276
277 is(j((1|2)&(3&4)), j(all(any(1,2),all(3,4))),
278 '((1|2)&(3&4)) equiv to all(any(1,2),all(3,4))');
279
280 is(j((1|2)|(3&4)), j(any(any(1,2),all(3,4))),
281 '((1|2)|(3&4)) equiv to any(any(1,2),all(3,4))');
282 }
283
284 # junction in boolean context
285 ok(?(0&0) == ?(0&&0), 'boolean context');
286 ok(?(0&1) == ?(0&&1), 'boolean context');
287 ok(?(1&1) == ?(1&&1), 'boolean context');
288 ok(?(1&0) == ?(1&&0), 'boolean context');
289 ok(!(?(0&0) != ?(0&&0)), 'boolean context');
290 ok(!(?(0&1) != ?(0&&1)), 'boolean context');
291 ok(!(?(1&1) != ?(1&&1)), 'boolean context');
292 ok(!(?(1&0) != ?(1&&0)), 'boolean context');
293
294
295 {
296 my $c = 0;
297 if 1 == 1 { $c++ }
298 is $c, 1;
299 if 1 == 1|2 { $c++ }
300 is $c, 2;
301 if 1 == 1|2|3 { $c++ }
302 is $c, 3;
303
304 $c++ if 1 == 1;
305 is $c, 4;
306 $c++ if 1 == 1|2;
307 is $c, 5, 'if modifier with junction should be called once';
308
309 $c = 0;
310 $c++ if 1 == 1|2|3;
311 is $c, 1, 'if modifier with junction should be called once';
312
313 $c = 0;
314 $c++ if 1 == any(1, 2, 3);
315 is $c, 1, 'if modifier with junction should be called once';
316 }
57e7ad80 »
2008-11-09 [t] move some junction tests
317
318 {
319 my @array = <1 2 3 4 5 6 7 8>;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
320 jok( all(@array) == one(@array), "all(@x) == one(@x) tests uniqueness(+ve)" );
57e7ad80 »
2008-11-09 [t] move some junction tests
321
322 push @array, 6;
e97f6d58 »
2009-01-19 [t/spec] avoid autohreading through ok()
323 jok( !( all(@array) == one(@array) ), "all(@x) == one(@x) tests uniqueness(-ve)" );
57e7ad80 »
2008-11-09 [t] move some junction tests
324
325 }
1c006225 »
2009-01-11 [t/spec] test for RT #60886
326
327 # used to be a rakudo regression (RT #60886)
f2f0e241 »
2010-02-27 [t/spec] A little re-fudging that I forgot to commit earlier.
328 ok Mu & Mu ~~ Mu, 'Mu & Mu ~~ Mu works';
310944af »
2009-03-20 test substr on junctions
329
d4cdad3f »
2009-03-25 testing index() with junction
330 ## See also S03-junctions/autothreading.t
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
331 #?rakudo skip 'substr on junctions'
310944af »
2009-03-20 test substr on junctions
332 {
333 is substr("abcd", 1, 2), "bc", "simple substr";
334 my $res = substr(any("abcd", "efgh"), 1, 2);
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
335 isa_ok $res, "junction";
336 ok $res eq "bc", "substr on junctions: bc";
337 ok $res eq "fg", "substr on junctions: fg";
310944af »
2009-03-20 test substr on junctions
338 }
339
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
340 #?rakudo skip 'substr on junctions'
310944af »
2009-03-20 test substr on junctions
341 {
342 my $res = substr("abcd", 1|2, 2);
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
343 isa_ok $res, "junction";
344 ok $res eq "bc", "substr on junctions: bc";
345 ok $res eq "cd", "substr on junctions: cd";
310944af »
2009-03-20 test substr on junctions
346 }
347
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
348 #?rakudo skip 'substr on junctions'
310944af »
2009-03-20 test substr on junctions
349 {
350 my $res = substr("abcd", 1, 1|2);
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
351 isa_ok $res, "junction";
352 ok $res eq "bc", "substr on junctions: bc";
353 ok $res eq "b", "substr on junctions: b";
310944af »
2009-03-20 test substr on junctions
354 }
355
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
356 #?rakudo skip 'index on junctions'
d4cdad3f »
2009-03-25 testing index() with junction
357 {
358 my $res = index(any("abcd", "qwebdd"), "b");
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
359 isa_ok $res, "junction";
360 ok $res == 1, "index on junctions: 1";
361 ok $res == 3, "index on junctions: 3";
d4cdad3f »
2009-03-25 testing index() with junction
362 }
363
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
364 #?rakudo skip 'index on junctions'
d4cdad3f »
2009-03-25 testing index() with junction
365 {
366 my $res = index("qwebdd", "b"|"w");
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
367 isa_ok $res, "junction";
368 ok $res == 1, "index on junctions: 1";
369 ok $res == 3, "index on junctions: 3";
d4cdad3f »
2009-03-25 testing index() with junction
370 }
371
30c8e176 »
2009-07-24 [t/spec] (perhaps incomplete) test for RT #63686
372 # RT #63686
373 {
374 lives_ok { try { for any(1,2) -> $x {}; } },
375 'for loop over junction in try block';
26751c81 »
2009-03-25 naive implementation of comparing two junctions
376
30c8e176 »
2009-07-24 [t/spec] (perhaps incomplete) test for RT #63686
377 sub rt63686 {
378 for any(1,2) -> $x {};
379 return 'happiness';
380 }
381 is rt63686(), 'happiness', 'for loop over junction in sub';
382 }
7f29bc53 »
2009-08-08 [t/spec] Add vim: lines everywhere.
383
3c2bc424 »
2009-09-15 * add tests for RT#67866
384 # RT#67866: [BUG] [LHF] Error with stringifying .WHAT on any junctions
8d4ec02f »
2009-11-04 [t/spec] remove some junction tests that relied on internal methods; …
385 #?rakudo skip 'lower case junction'
3c2bc424 »
2009-09-15 * add tests for RT#67866
386 {
ffa7511e »
2009-11-01 [t/spec/] "Junction" -> "junction", ".eigenstates" -> "!eigenstates" …
387 ok((WHAT any()) === junction, "test WHAT on empty any junction");
388 ok(any().WHAT === junction, "test WHAT on empty any junction");
389 ok((WHAT any(1,2)) === junction, "test WHAT on any junction");
390 ok(any(1,2).WHAT === junction, "test WHAT on any junction");
3c2bc424 »
2009-09-15 * add tests for RT#67866
391 }
4f9deaa0 »
2010-06-12 RT#75626 tests - Implement Any.all (and .any, .one, .none) in Rakudo
392
393 # Any list has junction methods
394 {
395 jok(5 < (6,7,8).all, '.all method builds "all" junction');
396 jok(!(7 < (6,7,8).all), '.all method builds "all" junction');
397 jok(7 == (6,7,8).one, '.one method builds "one" junction');
398 jok(9 == (6,7,8).none, '.none method builds "none" junction');
399
400 my @x = (6,7,8);
401 jok(5 < @x.all, '.all method works on array objects');
402 }
8d4ec02f »
2009-11-04 [t/spec] remove some junction tests that relied on internal methods; …
403 done_testing();
3c2bc424 »
2009-09-15 * add tests for RT#67866
404
7f29bc53 »
2009-08-08 [t/spec] Add vim: lines everywhere.
405 # vim: ft=perl6
Something went wrong with that request. Please try again.