Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 380 lines (299 sloc) 11.044 kb
58135b30 » moritz
2008-05-08 [t/spec] changed 'use v6-alpha;' to 'use v6;'
1 use v6;
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
2 use Test;
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
3 BEGIN { @*INC.push('t/spec/packages/') };
4 use Test::Util;
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
5
f660aa63 » cosimo
2008-01-28 [t/spec] Possibly converted all remaining pod markers to pod6
6 =begin pod
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
7
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
8 'Mu' and 'undefine' tests
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
9
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
10 This test file contains two sections: a port of the perl5 'undef.t' tests, and
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
11 perl6-specific tests.
12
f660aa63 » cosimo
2008-01-28 [t/spec] Possibly converted all remaining pod markers to pod6
13 =end pod
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
14
15 # Note: See thread "Undef issues" by Adrian Taylor on p6l
16 # L<http://groups.google.com/groups?threadm=20050601002444.GB32060@wall.org>
17 # On Tue, May 24, 2005 at 10:53:59PM +1000, Stuart Cook wrote:
18 # : I'm not sure whether this behaviour is supposed to be changing.
19 #
20 # It is. I think we decided to make the value undef, and the function
21 # undefine(). (But these days most values of undef really ought to
22 # be constructed and returned (or thrown) using fail().)
23 #
24 # Larry
25
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
26 plan *;
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
27
28 our $GLOBAL;
f660aa63 » cosimo
2008-01-28 [t/spec] Possibly converted all remaining pod markers to pod6
29
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
30 # L<S32::Basics/Mu/=item defined>
f660aa63 » cosimo
2008-01-28 [t/spec] Possibly converted all remaining pod markers to pod6
31
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
32 ok(Mu === Mu, "Mu is equal to Mu");
33 ok(!defined(Mu), "Mu is not defined");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
34
35 {
36 my $a;
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
37 ok(!defined($a), "uninitialized lexicals are undefined");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
38
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
39 ok(!defined($GLOBAL), "uninitialized package vars are undefined");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
40
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
41 $a += 1;
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
42 ok(defined($a), "initialized var is defined");
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
43 is_run( 'my $a; $a += 1', { err => '', out => '', status => 0 },
44 'increment of undefined variable does not warn' );
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
45
46 undefine $a;
47 ok(!defined($a), "undefine($a) does");
48
49 $a = "hi";
50 ok(defined($a), "string");
51
52 my $b;
53 $a = $b;
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
54 ok(!defined($a), "assigning another undefined lexical");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
55
56 $a = $GLOBAL;
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
57 ok(!defined($a), "assigning another undefined global");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
58 }
f660aa63 » cosimo
2008-01-28 [t/spec] Possibly converted all remaining pod markers to pod6
59
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
60 # L<S32::Basics/Mu/"=item undefine">
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
61 {
62 my @ary = "arg1";
63 my $a = @ary.pop;
64 ok(defined($a), "pop from array");
65 $a = @ary.pop;
66 ok(!defined($a), "pop from empty array");
67
68 @ary = "arg1";
69 $a = @ary.shift;
70 ok(defined($a), "shift from array");
71 $a = @ary.shift;
72 ok(!defined($a), "shift from empty array");
73
74 my %hash = ( bar => 'baz', quux => 'quuz' );
75 ok(defined(%hash<bar>), "hash subscript");
76 ok(!defined(%hash<bargho>), "non-existent hash subscript");
77
78 undefine %hash<bar>;
79 ok(!defined(%hash<bar>), "undefine hash subscript");
80
81 %hash<bar> = "baz";
82 %hash.delete("bar");
83 ok(!defined(%hash<bar>), "delete hash subscript");
84
85 ok(defined(@ary), "aggregate array defined");
86 ok(defined(%hash), "aggregate hash defined");
87
88 undefine(@ary);
a20c69c2 » lwall
2008-02-10 [t/spec/*.t] :todo whackage
89 #?pugs todo 'bug'
173bb698 » moritz
2010-03-31 [t/spec] correct undef.t, and fudge for rakudo
90 #?rakudo todo 'definedness of array'
a20c69c2 » lwall
2008-02-10 [t/spec/*.t] :todo whackage
91 ok(!defined(@ary), "undefine array");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
92
173bb698 » moritz
2010-03-31 [t/spec] correct undef.t, and fudge for rakudo
93 #?rakudo emit #
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
94 undefine(%hash);
a20c69c2 » lwall
2008-02-10 [t/spec/*.t] :todo whackage
95 #?pugs todo 'bug'
173bb698 » moritz
2010-03-31 [t/spec] correct undef.t, and fudge for rakudo
96 #?rakudo todo 'definedness of hash'
a20c69c2 » lwall
2008-02-10 [t/spec/*.t] :todo whackage
97 ok(!defined(%hash), "undefine hash");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
98
99 @ary = (1);
100 ok(defined(@ary), "define array again");
101 %hash = (1,1);
102 ok(defined(%hash), "define hash again");
103 }
104
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
105 #?rakudo skip 'access to &your_sub'
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
106 {
107 sub a_sub { "møøse" }
108
109 ok(defined(&a_sub), "defined sub");
a20c69c2 » lwall
2008-02-10 [t/spec/*.t] :todo whackage
110 #?pugs todo 'parsefail'
111 ok(eval('defined(%«$?PACKAGE\::»<&a_sub>)'), "defined sub (symbol table)");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
112
a20c69c2 » lwall
2008-02-10 [t/spec/*.t] :todo whackage
113 #?pugs todo 'feature'
114 ok(eval('!defined(&a_subwoofer)'), "undefined sub");
115 #?pugs todo 'feature'
116 ok(eval('!defined(%«$?PACKAGE\::»<&a_subwoofer>)'), "undefined sub (symbol table)");
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
117
118 dies_ok { undefine &a_sub }, 'die trying to undefine a sub';
119 ok defined &a_sub, 'sub is still defined after attempt to undefine';
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
120 }
121
122 # TODO: find a read-only value to try and assign to, since we don't
123 # have rules right now to play around with (the p5 version used $1)
124 #eval { "constant" = "something else"; };
125 #is($!, "Modification of a read", "readonly write yields exception");
126
127 # skipped tests for tied things
128
129 # skipped test for attempt to undef a bareword -- no barewords here.
130
131 # TODO: p5 "bugid 3096
132 # undefing a hash may free objects with destructors that then try to
133 # modify the hash. To them, the hash should appear empty."
134
135
136 # Test LHS assignment to undef:
297e7835 » moritz
2009-01-05 [t] and [t/spec]
137 # XXX shouldn't that be * instead of undef?
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
138 # yes, this chunk should move to a different file --Larry
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
139
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
140 {
141 my $interesting;
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
142 (*, *, $interesting) = (1,2,3);
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
143 is($interesting, 3, "Undef on LHS of list assignment");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
144
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
145 (*, $interesting, *) = (1,2,3);
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
146 is($interesting, 2, "Undef on LHS of list assignment");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
147
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
148 ($interesting, *, *) = (1,2,3);
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
149 is($interesting, 1, "Undef on LHS of list assignment");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
150
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
151 sub two_elements() { (1,2) };
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
152 (*,$interesting) = two_elements();
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
153 is($interesting, 2, "Undef on LHS of function assignment");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
154
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
155 ($interesting, *) = two_elements();
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
156 is($interesting, 1, "Undef on LHS of function assignment");
157 }
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
158
f660aa63 » cosimo
2008-01-28 [t/spec] Possibly converted all remaining pod markers to pod6
159 =begin pod
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
160
161 Perl6-specific tests
162
f660aa63 » cosimo
2008-01-28 [t/spec] Possibly converted all remaining pod markers to pod6
163 =end pod
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
164
173bb698 » moritz
2010-03-31 [t/spec] correct undef.t, and fudge for rakudo
165 #?rakudo skip 'fun with undefine'
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
166 {
167 # aggregate references
168
169 my @ary = (<a b c d e>);
170 my $ary_r = @ary; # ref
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
171 isa_ok($ary_r, Array);
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
172 ok(defined($ary_r), "array reference");
173
174 undefine @ary;
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
175 ok(!+$ary_r, "undefine array referent");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
176
177 is(+$ary_r, 0, "dangling array reference");
178
179 my %hash = (1, 2, 3, 4);
180 my $hash_r = %hash;
181 isa_ok($hash_r, "Hash");
182 ok(defined($hash_r), "hash reference");
183 undefine %hash;
184 ok(defined($hash_r), "undefine hash referent:");
185 is(+$hash_r.keys, 0, "dangling hash reference");
186 }
187
188 {
189 my Array $an_ary;
190 ok(!defined($an_ary), "my Array");
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
191 ok((try { !defined($an_ary[0]) }), "my Array subscript - Mu");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
192 try { $an_ary.push("blergh") };
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
193 ok((try { defined($an_ary.pop) }), "push");
194 ok((try { !defined($an_ary.pop) }), "comes to shove");
02df2396 » pmichaud
2010-07-06 Unfudge some passing autoviv tests.
195 }
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
196
02df2396 » pmichaud
2010-07-06 Unfudge some passing autoviv tests.
197 #?rakudo skip 'Autovivify hashes'
198 {
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
199 my Hash $a_hash;
200
201 ok(!defined($a_hash), "my Hash");
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
202 ok((try { !defined($a_hash<blergh>) }), "my Hash subscript - Mu");
203 ok((try { !defined($a_hash<blergh>) }), "my Hash subscript - Mu, no autovivification happened");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
204
205 $a_hash<blergh> = 1;
206 ok(defined($a_hash.delete('blergh')), "delete");
207 ok(!defined($a_hash.delete("blergh")), " - once only");
02df2396 » pmichaud
2010-07-06 Unfudge some passing autoviv tests.
208 }
209
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
210
02df2396 » pmichaud
2010-07-06 Unfudge some passing autoviv tests.
211 {
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
212 class Dog {};
213 my Dog $spot;
214
215 ok(!defined($spot), "Unelaborated mutt");
216 $spot .= new;
217 ok(defined $spot, " - now real");
218 }
219
220 # rules
221 # TODO. refer to S05
222 # L<S05/Match objects/"they will all be undefined" closure
223 # "let keyword">
224
ea2ee24f » lwall
2008-07-24 [STD] various bugs
225 # - unmatched alternative should bind to undef
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
226 #?rakudo skip 'null PMC access in type()'
ece272c0 » moritz
2008-09-24 [t/spec] fudged undef.t for rakudo
227 #?DOES 10
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
228 {
4ad9719d » lwall
2008-12-31 [undef.t] there is no my() function...declarators require space
229 my ($num, $alpha);
8dc7d4b8 » lwall
2010-07-15 [t/spec] mark various tests that intentionally declare things that ar…
230 my ($rx1, $rx2); #OK not used
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
231 eval '
232 $rx1 = rx
233 / [ (\d+) { let $<num> := $0 }
234 | (<alpha>+) { let $<alpha> := $1 }
235 ]
236 /;
237 $rx2 = rx
238 / [ $<num> := (\d+)
239 | $<alpha>:= (<alpha>+)
240 ]
241 /;
242 ';
243 for (<rx1 rx2>) {
244 # I want symbolic lookups because I need the rx names for test results.
245
246 eval '"1" ~~ %MY::{$_}';
247 #?pugs todo 'unimpl'
248 ok(defined($num), '{$_}: successful hypothetical');
249 ok(!defined($alpha), '{$_}: failed hypothetical');
250
251 eval '"A" ~~ %MY::{$_}';
252 ok(!defined($num), '{$_}: failed hypothetical (2nd go)');
253 #?pugs todo 'unimpl'
254 ok(defined($alpha), '{$_}: successful hypothetical (2nd go)');
255 }
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
256
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
257 # - binding to hash keys only would leave values undefined
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
258 eval '"a=b\nc=d\n" ~~ / $<matches> := [ (\w) = \N+ ]* /';
259 #?pugs todo 'unimpl'
260 ok(eval('$<matches> ~~ all(<a b>)'), "match keys exist");
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
261
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
262 #ok(!defined($<matches><a>) && !defined($<matches><b>), "match values don't");
263 #?pugs todo 'unimpl'
264 ok(0 , "match values don't");
265 }
36041003 » lwall
2008-07-24 more buglets
266
ece272c0 » moritz
2008-09-24 [t/spec] fudged undef.t for rakudo
267 #?DOES 1
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
268 {
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
269 # - $0, $1 etc. should all be undefined after a failed match
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
270 # (except for special circumstances)
972b6e4f » moritz
2009-02-26 [t/spec] simplify a few tests to use /../ instead of rx/../
271 "abcde" ~~ /(.)(.)(.)/;
272 "abcde" ~~ /(\d)/;
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
273 ok((!try { grep { defined($_) }, ($0, $1, $2, $3, $4, $5) }),
274 "all submatches undefined after failed match") or
275 diag("match state: " ~ eval '$/');
276
277 # XXX write me: "special circumstances"
278 }
279
280
281 # subroutines
282 {
283 sub bar ($bar, $baz?, :$quux) {
284 is($bar, "BAR", "defined param"); # sanity
285
60d29c60 » szabgab
2009-04-24 fix some legacy smartlink syntax
286 # L<S06/Optional parameters/Missing optional arguments>
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
287 ok(!defined($baz), "unspecified optional param");
288
60d29c60 » szabgab
2009-04-24 fix some legacy smartlink syntax
289 # L<S06/Named parameters/Named parameters are optional>
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
290 ok(!defined($quux), "unspecified optional param");
291 }
292
293 bar("BAR");
294
295 }
296
297 # autoloading
298 # L<S10/Autoloading>
299
300 # Currently waiting on
301 # - packages
302 # - symtable hash
303 # - autoloading itself
304
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
305 #?pugs skip 'parsefail'
306 #?rakudo skip 'parsefail'
307 flunk('FIXME: parsefail');
f9002e6d » lwall
2008-07-22 [STD] now does reduce tokens correctly; we now use a variable length
308 # {
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
309 # package AutoMechanic {
310 # AUTOSCALAR { \my $_scalar }
311 # AUTOARRAY { \my @_array }
312 # AUTOHASH { \my %_hash }
313 # AUTOSUB { { "code" } }
314 # AUTOMETH { { "code" } }
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
315 #
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
316 # AUTOSCALARDEF { %::«{'$' ~ $_}» = "autoscalardef" }
317 # AUTOARRAYDEF { %::«{'@' ~ $_}» = "autoarraydef".split("") }
318 # AUTOHASHDEF { %::«{'%' ~ $_}» = <autohashdef yes> }
319 # AUTOSUBDEF { %::«{'&' ~ $_}» = { "autosubdef" } }
320 # AUTOMETHDEF { %::«{'&' ~ $_}» = { "automethdef" } }
321 # }
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
322 #
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
323 # is(WHAT $AutoMechanic::scalar0, "Scalar", "autoload - scalar");
324 # is(WHAT @AutoMechanic::array0, "Array", "autoload - array");
325 # is(WHAT %AutoMechanic::hash, "Hash", "autoload - hash");
326 # is(WHAT &AutoMechanic::sub0, "Code", "autoload - sub");
327 # is(WHAT AutoMechanic.can("meth0"), "Code", "autoload - meth");
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
328 #
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
329 # is($AutoMechanic::scalar, "autoscalardef", "autoloaddef - scalar");
330 # is(~@AutoMechanic::ary, ~("autoarraydef".split(""), "autoloaddef - array");
331 # is(~%AutoMechanic::hash, ~<autohashdef yes>, "autoloaddef - hash");
332 # is(&AutoMechanic::sub.(), "autosubdef", "autoloaddef - sub");
333 # is(AutoMechanic.meth(), "automethdef", "autoloaddef - method");
f9002e6d » lwall
2008-07-22 [STD] now does reduce tokens correctly; we now use a variable length
334 # }
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
335
336 # Extra tests added due to apparent bugs
173bb698 » moritz
2010-03-31 [t/spec] correct undef.t, and fudge for rakudo
337 is((Any) + 1, 1, 'Any + 1');
338 is(1 + (Any), 1, '1 + Any');
339 is((Any) * 2, 0, 'Any * 2');
340 is(2 * (Any), 0, '2 * Any');
341 is((Any) xx 2, [Any, Any], 'Any xx 2');
342 is((Any) * (Any), 0, 'Any * Any');
08d48bde » cosimo
2008-01-26 [t] Test suite refactoring.
343
344 # L<http://colabti.de/irclogger/irclogger_log/perl6?date=2006-09-12,Tue&sel=145#l186>
345 # See log above. From IRC, TimToady says that both of these
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
346 # should be false. (At time of writing, @(Mu,) is true.)
a20c69c2 » lwall
2008-02-10 [t/spec/*.t] :todo whackage
347 #?pugs todo 'feature', :depends<@() imposing context and not [] constructor>;
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
348 #?rakudo 2 skip 'todo: lists, defined, truthness'
8f9a1198 » lwall
2009-11-25 [t/] unify compartmentalized undef and Object concepts into Mu
349 is ?(@(Mu,)), Bool::False, '?(@(Mu,)) is false';
350 is ?(list(Mu,)), Bool::False, '?(@(Mu,)) is false';
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
351
e702d26f » moritz
2009-01-05 [t/spec] really test for #61868 this time
352 lives_ok { uc(eval("")) }, 'can use eval("") in further expressions';
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
353
354 {
355 sub lie { Bool::False }
356 ok lie() ~~ Bool, 'sub returns a bool';
357 dies_ok { undefine lie }, 'attempt to undefine returned Bool type dies';
358 ok lie() ~~ Bool, 'sub still returns a bool';
359 }
360
361 {
362 sub def { my $x = [] }
363 ok def() ~~ Array, 'sub returns array';
364 lives_ok { undefine def }, 'attempt to undefine returned array lives';
365 ok def() ~~ Array, 'sub still returns array';
366
367 dies_ok { undefine &def }, 'attempt to undefine sub dies';
368 ok defined &def, 'attempt to undefine sub fails';
f0006727 » kyle
2009-10-28 [t/spec] Test suggested by moritz++
369 ok def() ~~ Array, 'can still call sub after attempt to undefine it';
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
370 }
371
29deb7ff » moritz
2010-04-04 [t/spec] test that you can undefine a lexical variable twice; RT #69238
372 # RT #69238
373 {
374 sub foo { my $a = "baz"; undefine $a; undefine $a; $a; }
375 ok !defined(foo()), 'can undefine $a twice without any troubles';
376 }
377
ae012059 » kyle
2009-10-28 [t/spec] Tests inspired by IRC: http://irclog.perlgeek.de/perl6/2009-…
378 done_testing;
379
5f0915da » moritz
2008-09-11 [t/spec] partially fudge undef.t for rakudo. Pending fudge bugs.
380 # vim: ft=perl6
Something went wrong with that request. Please try again.