Permalink
Browse files

[t/spec]: Update some Nil-related tests for undefined Nil.

git-svn-id: http://svn.pugscode.org/pugs@32057 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 6df68e5 commit feebd088816019570305441a8e9ca8de98378459 pmichaud committed Aug 19, 2010
@@ -31,9 +31,8 @@ ok (my $y = ()).defined, 'assigning () to scalar results in a defined parcel';
$calls = 0;
ok return_nil() ~~ Nil, 'return_nil() ~~ Nil';
- is return_nil().WHAT, 'Parcel()', 'return_nil().WHAT says Parcel';
- is return_nil.WHAT, 'Parcel()', 'return_nil.WHAT says Nil';
- is $calls, 3, 'return_nil() called thrice';
+ is return_nil().WHAT, 'Nil()', 'return_nil().WHAT says Nil';
+ is $calls, 2, 'return_nil() called twice';
my $n = return_nil();
ok $n.notdef, 'variable holding nil is not defined';
@@ -6,7 +6,7 @@ plan *;
{
# Nil is an empty container. As a container, it is defined.
- ok Nil.defined, 'Nil is defined';
+ ok !Nil.defined, 'Nil is undefined';
ok ().defined, '() is defined';
my @a;
@a.push: Nil;
@@ -24,9 +24,9 @@ plan *;
@a.push: 2, sink { $i = 2 };
is @a.elems, 1, 'sink block prefix returns Nil (list context)';
is $i, 2, 'the block was executed';
- ok defined(sink $i = 5 ), 'sink in scalar context (statement)';
+ ok !defined(sink $i = 5 ), 'sink in scalar context (statement)';
is $i, 5, '... statement executed';
- ok defined(sink {$i = 8} ), 'sink in scalar context (block)';
+ ok !defined(sink {$i = 8} ), 'sink in scalar context (block)';
is $i, 8, '... block executed';
}
View
@@ -466,7 +466,7 @@ eval_dies_ok('for(0..5) { }','keyword needs at least one whitespace after it');
{
sub rt71268 { for ^1 {} }
lives_ok { ~(rt71268) }, 'can stringify "for ^1 {}" without death';
- ok rt71268() ~~ Nil, 'result of "for ^1 {}" is Nil (what else?)';
+ ok rt71268() ~~ (), 'result of "for ^1 {}" is ()';
}
# RT 62478
@@ -159,11 +159,11 @@ plan 67;
take [$cond,$count];
}
}
- is prime_factors_mult(1),[], "We ignore 1";
- is prime_factors_mult(2),[[2,1]], "We get prime numbers prime";
- is prime_factors_mult(4),[[2,2]], ".. and multiplicity right";
- is prime_factors_mult(12),[[2,2],[3,1]], ".. and products of primes";
- is prime_factors_mult(315),[[3,2],[5,1],[7,1]], ".. and ignore multiplicity 0"
+ is prime_factors_mult(1),(), "We ignore 1";
+ is prime_factors_mult(2),([2,1]), "We get prime numbers prime";
+ is prime_factors_mult(4),([2,2]), ".. and multiplicity right";
+ is prime_factors_mult(12),([2,2],[3,1]), ".. and products of primes";
+ is prime_factors_mult(315),([3,2],[5,1],[7,1]), ".. and ignore multiplicity 0"
}
{

0 comments on commit feebd08

Please sign in to comment.