Skip to content

Commit

Permalink
[t/spec] many test fixes, mostly related to undef
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@22215 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Sep 11, 2008
1 parent ade5265 commit 8c8fd13
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 58 deletions.
2 changes: 1 addition & 1 deletion S02-builtin_data_types/anon_block.t
Expand Up @@ -84,7 +84,7 @@ my $two;
# Additionally, a smart compiler will detect thus errors at compile-time, so I
# added an eval(). --iblech
try { eval '0,{$one = 1}{$two = 2}' };
is($one, undef, 'two blocks ({} {}) no semicolon after either,.. first block does not execute');
ok(!defined($one), 'two blocks ({} {}) no semicolon after either,.. first block does not execute');
#?rakudo todo 'blocks as subscripts (?)'
is($two, 2, '... but second block does (parsed as hash subscript)');

Expand Down
4 changes: 2 additions & 2 deletions S02-builtin_data_types/array.t
Expand Up @@ -53,7 +53,7 @@ my @array2 = ("test", 1, undef);

#?rakudo todo 'list assignment'
is(+@array4, 3, 'the array4 has 3 elements');
is(@array4[0], undef, 'got the right value at array4 index 0');
ok(!defined(@array4[0]), 'got the right value at array4 index 0');
#?rakudo 2 todo 'list assignment'
is(@array4[1], 1, 'got the right value at array4 index 1');
is(@array4[2], 'test', 'got the right value at array4 index 2');
Expand All @@ -66,7 +66,7 @@ my @array2 = ("test", 1, undef);

#?rakudo todo 'array slices and list assignment'
is(+@array5, 6, 'the array5 has 6 elements');
is(@array5[0], undef, 'got the right value at array5 index 0');
ok(!defined(@array5[0]), 'got the right value at array5 index 0');
#?rakudo 5 todo 'array slices and list assignment'
is(@array5[1], 1, 'got the right value at array5 index 1');
is(@array5[2], 'test', 'got the right value at array5 index 2');
Expand Down
4 changes: 2 additions & 2 deletions S02-builtin_data_types/array_ref.t
Expand Up @@ -49,7 +49,7 @@ isa_ok($array_ref4, Array);
my $array_ref5 = [ $array_ref2[2, 1, 0], $array_ref1[2, 1, 0] ];
isa_ok($array_ref5, Array);

#?rakudo skip 'flatten and slices are not working'
#?rakudo todo 'flatten and slices are not working'
{
is(+$array_ref5, 6, 'the array_ref5 has 6 elements');
is(!$array_ref5[0].defined, 'got the right value at array_ref5 index 0');
Expand Down Expand Up @@ -79,7 +79,7 @@ isa_ok($array_ref5, Array);
my $array_ref7 = [ $array_ref1[(2, 1, 0)] ];
isa_ok($array_ref7, Array);

#?rakudo skip 'flatten and slices are not working'
#?rakudo todo 'flatten and slices are not working'
{
is(+$array_ref7, 3, 'the array_ref7 has 3 elements');
is($array_ref7[0], 'baz', 'got the right value at array_ref7 index 0');
Expand Down
4 changes: 2 additions & 2 deletions S02-builtin_data_types/num.t
Expand Up @@ -150,12 +150,12 @@ plan 47;

is(42_000, 42000, 'underscores allowed (and ignored) in numeric literals');
is(42_127_000, 42127000, 'multiple underscores ok');
#?rakudo 2 skip "underscores cause weird IMCC errors"
#?rakudo 2 todo "underscores cause weird IMCC errors"
is(42.0_1, 42.01, 'underscores in fraction ok');
is(4_2.01, 42.01, 'underscores in whole part ok');

eval_dies_ok('4_2._0_1', 'single underscores are not ok directly after the dot');
#?rakudo skip 'Underscores in numbers'
#?rakudo todo 'Underscores in numbers'
is(4_2.0_1, 42.01, 'single underscores are ok');

is 0_1, 1, "0_1 is parsed as 0d1";
Expand Down
2 changes: 1 addition & 1 deletion S02-literals/hash-interpolation.t
Expand Up @@ -27,7 +27,7 @@ plan 10;
is "%hash", '%hash', 'no interpolation';
}

#?rakudo skip 'Hash interpolation'
#?rakudo todo 'Hash interpolation'
{
# "%hash{a}" actually calls a(). Test that.
my %hash = (a => 1, b => 2);
Expand Down
5 changes: 3 additions & 2 deletions S02-literals/quoting.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 198;
plan 199;

my $foo = "FOO";
my $bar = "BAR";
Expand All @@ -13,7 +13,7 @@ Tests quoting constructs as defined in L<S02/Literals>
=todo
* Q, q:b, and other interpolation levels (half-done)
* q:b and other interpolation levels (half-done)
* meaningful quotations (qx, rx, etc)
* review shell quoting semantics of «»
* arrays in «»
Expand Down Expand Up @@ -47,6 +47,7 @@ Tests quoting constructs as defined in L<S02/Literals>
ok Q{\n}.chars == 2, 'Q{..} do not interpolate \n';
is Q{$x}, '$x', 'Q{..} do not interpolate scalars';
ok Q{$x}.chars == 2, 'Q{..} do not interpolate scalars';
is Q {\\}, '\\\\', 'Q {..} quoting';
}

#?rakudo skip 'Q quoting'
Expand Down
3 changes: 0 additions & 3 deletions S02-names_and_variables/perl.t
Expand Up @@ -35,11 +35,8 @@ my @tests = (
[], # empty array
[ 42 ], # only one elem
[< a b c>],
#?rakudo emit # {...}.perl is invalid
{}, # empty hash
#?rakudo emit # {...}.perl is invalid
{ a => 42 }, # only one elem
#?rakudo emit # {...}.perl is invalid
{ :a(1), :b(2), :c(3) },

[ 3..42 ],
Expand Down

0 comments on commit 8c8fd13

Please sign in to comment.