Skip to content

Commit

Permalink
niecza fudging
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Oct 17, 2011
1 parent 000e1e4 commit 3a7da94
Show file tree
Hide file tree
Showing 29 changed files with 106 additions and 12 deletions.
3 changes: 3 additions & 0 deletions S03-smartmatch/hash-hash.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ my %hash5 = ( "foo" => 1, "bar" => 1, "gorch" => Mu, "baz" => Mu );


{ {
#?rakudo todo 'nom regression' #?rakudo todo 'nom regression'
#?niecza todo
ok (%hash1 ~~ %hash2), 'Hash ~~ Hash (same keys, +)'; ok (%hash1 ~~ %hash2), 'Hash ~~ Hash (same keys, +)';
ok !(%hash1 ~~ %hash3), 'Hash ~~ Hash (same keys, -)'; ok !(%hash1 ~~ %hash3), 'Hash ~~ Hash (same keys, -)';
#?pugs todo #?pugs todo
#?rakudo todo 'nom regression' #?rakudo todo 'nom regression'
#?niecza todo
ok eval_elsewhere('(%hash1 ~~ %hash2)'), "hash keys identical"; ok eval_elsewhere('(%hash1 ~~ %hash2)'), "hash keys identical";
#?niecza skip 'System.IndexOutOfRangeException: Array index is out of range.'
ok eval_elsewhere('!(%hash1 ~~ %hash4)'), "hash keys differ"; ok eval_elsewhere('!(%hash1 ~~ %hash4)'), "hash keys differ";
} }


Expand Down
4 changes: 4 additions & 0 deletions S05-match/arrayhash.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ plan 8;
my @a = ('a', 'b' ); my @a = ('a', 'b' );
ok(@a ~~ / 'b' /); ok(@a ~~ / 'b' /);
#?rakudo todo 'nom regression' #?rakudo todo 'nom regression'
#?niecza todo
ok(@a ~~ / ^ 'b' /); ok(@a ~~ / ^ 'b' /);
ok(@a ~~ / ^ 'a' /); ok(@a ~~ / ^ 'a' /);
#?rakudo todo 'nom regression' #?rakudo todo 'nom regression'
#?niecza todo
ok(@a ~~ / ^ 'a' $ /); ok(@a ~~ / ^ 'a' $ /);


# Matching against a hash should be true if any of the keys match. # Matching against a hash should be true if any of the keys match.
my %a = ('a' => 1, 'b' => 2); my %a = ('a' => 1, 'b' => 2);
ok(%a ~~ / 'b' /); ok(%a ~~ / 'b' /);
#?rakudo todo 'nom regression' #?rakudo todo 'nom regression'
#?niecza todo
ok(%a ~~ / ^ 'b' /); ok(%a ~~ / ^ 'b' /);
ok(%a ~~ / ^ 'a' /); ok(%a ~~ / ^ 'a' /);
#?rakudo todo 'nom regression' #?rakudo todo 'nom regression'
#?niecza todo
ok(%a ~~ / ^ 'a' $ /); ok(%a ~~ / ^ 'a' $ /);


# vim: ft=perl6 # vim: ft=perl6
5 changes: 5 additions & 0 deletions S09-autovivification/autovivification.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ plan 42;
# XXX I understand that @array[0].push(...) should autovivify an Array # XXX I understand that @array[0].push(...) should autovivify an Array
# in @array[0], but is that also true for a normal scalar? # in @array[0], but is that also true for a normal scalar?
#?rakudo skip 'autoviv with push/unshift' #?rakudo skip 'autoviv with push/unshift'
#?niecza skip 'Unable to resolve method push in class Any'
{ {
my $arrayref; my $arrayref;


Expand All @@ -43,6 +44,7 @@ plan 42;
} }


#?rakudo skip 'autoviv with push/unshift' #?rakudo skip 'autoviv with push/unshift'
#?niecza skip 'Unable to resolve method unshift in class Any'
{ {
my $arrayref; my $arrayref;


Expand All @@ -53,6 +55,7 @@ plan 42;
# Autovification by push, unshift, etc. of an array/hash element # Autovification by push, unshift, etc. of an array/hash element
# L<S09/Autovivification/"push, unshift, .[]"> # L<S09/Autovivification/"push, unshift, .[]">
#?rakudo skip 'autoviv with push/unshift' #?rakudo skip 'autoviv with push/unshift'
#?niecza skip 'Unable to resolve method push in class Any'
{ {
my @array; my @array;


Expand All @@ -61,6 +64,7 @@ plan 42;
} }


#?rakudo skip 'autoviv with push/unshift' #?rakudo skip 'autoviv with push/unshift'
#?niecza skip 'Unable to resolve method push in class Any'
{ {
my %hash; my %hash;


Expand All @@ -78,6 +82,7 @@ plan 42;


$hashref<key> = 23; $hashref<key> = 23;
is $hashref<key>, 23, "hash element assignment worked"; is $hashref<key>, 23, "hash element assignment worked";
#?niecza skip 'No value for parameter \$other in CORE Any.isa'
ok $hashref.isa !~~ Hash, "uninitialized variable was autovivified to a hash (1)"; ok $hashref.isa !~~ Hash, "uninitialized variable was autovivified to a hash (1)";
} }


Expand Down
8 changes: 7 additions & 1 deletion S12-attributes/augment-and-initialization.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ diag('Test for class attribute initialization');
{ {
class T1 { } class T1 { }
class T2 { } class T2 { }
#?niecza todo
eval_lives_ok 'use MONKEY_TYPING; augment class T1 { has $.t = 1 }; 1', eval_lives_ok 'use MONKEY_TYPING; augment class T1 { has $.t = 1 }; 1',
"Try to initialize public attribute"; "Try to initialize public attribute";


eval_lives_ok q' #?niecza todo
eval_lives_ok q'
use MONKEY_TYPING; use MONKEY_TYPING;
augment class T2 { augment class T2 {
has $!t = 2; has $!t = 2;
Expand All @@ -33,19 +35,23 @@ diag('Test for class attribute initialization');


$o1 = T1.new(); $o1 = T1.new();
$o2 = T2.new(); $o2 = T2.new();
#?niecza skip 'Unable to resolve method t in class T1'
is $o1.t, 1, is $o1.t, 1,
"Testing value for initialized public attribute."; "Testing value for initialized public attribute.";
dies_ok { $o2.t }, dies_ok { $o2.t },
"Try to access the initialized private attribute."; "Try to access the initialized private attribute.";
#?niecza todo
is try { $o2.get }, 2, is try { $o2.get }, 2,
"Testing value for initialized private attribue."; "Testing value for initialized private attribue.";


$o1 = T1.new( t => 3 ); $o1 = T1.new( t => 3 );
$o2 = T2.new( t => 4 ); $o2 = T2.new( t => 4 );
#?niecza skip 'Unable to resolve method t in class T1'
is $o1.t, 3, is $o1.t, 3,
"Testing value for attributes which is initialized by constructor."; "Testing value for attributes which is initialized by constructor.";
dies_ok { $o2.t }, dies_ok { $o2.t },
"Try to access the private attribute which is initialized by constructor."; "Try to access the private attribute which is initialized by constructor.";
#?niecza todo
is try { $o2.get }, 4, is try { $o2.get }, 4,
"Testing value for private attribue which is initialized by constructor."; "Testing value for private attribue which is initialized by constructor.";
} }
Expand Down
2 changes: 2 additions & 0 deletions S12-class/anonymous.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ my $t1 = $c1.new();
ok(defined($t1), 'instantiated the class'); ok(defined($t1), 'instantiated the class');
ok($t1 ~~ $c1, 'isa check works'); ok($t1 ~~ $c1, 'isa check works');
#?rakudo todo 'Anonymous class stringification (?)' #?rakudo todo 'Anonymous class stringification (?)'
#?niecza todo
is($c1.WHAT().gist, '()', '.WHAT.gist stringifies to ()'); is($c1.WHAT().gist, '()', '.WHAT.gist stringifies to ()');


# Anonymous classes with methods. # Anonymous classes with methods.
Expand Down Expand Up @@ -63,6 +64,7 @@ is($t3.x, 42, 'anonymous classes can have attributes');
lives_ok { $i1 = rt64888() }, 'can get anonymous class instance once'; lives_ok { $i1 = rt64888() }, 'can get anonymous class instance once';
lives_ok { $i2 = rt64888() }, 'can get anonymous class instance twice'; lives_ok { $i2 = rt64888() }, 'can get anonymous class instance twice';


#?niecza todo
is ~$i1, 'RT #64888', 'anonymous class stringified works'; is ~$i1, 'RT #64888', 'anonymous class stringified works';
is +$i1, 64888, 'anonymous class numified works'; is +$i1, 64888, 'anonymous class numified works';
} }
Expand Down
16 changes: 12 additions & 4 deletions S12-class/basic.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ ok($foo ~~ Foo, '... smartmatch our $foo to the Foo class');
# override the behaviour without playing with the metamodel via traits # override the behaviour without playing with the metamodel via traits
ok($foo.isa(Foo), '.isa(Foo)'); ok($foo.isa(Foo), '.isa(Foo)');
ok($foo.isa(::Foo), '.isa(::Foo)'); ok($foo.isa(::Foo), '.isa(::Foo)');
#?niecza todo
ok($foo.isa("Foo"), '.isa("Foo")'); ok($foo.isa("Foo"), '.isa("Foo")');
ok(!$foo.isa("Bar"), '!.isa("Bar")'); ok(!$foo.isa("Bar"), '!.isa("Bar")');


#?niecza skip 'Unable to resolve method clone in class Foo'
{ {
my $foo_clone = $foo.clone(); my $foo_clone = $foo.clone();
ok($foo_clone ~~ Foo, '... smartmatch our $foo_clone to the Foo class'); ok($foo_clone ~~ Foo, '... smartmatch our $foo_clone to the Foo class');
Expand Down Expand Up @@ -57,6 +59,7 @@ ok($bar.isa(Bar), "... .isa(Bar)");
ok($bar ~~ Foo, '... smartmatch our $bar to the Foo class'); ok($bar ~~ Foo, '... smartmatch our $bar to the Foo class');
ok($bar.isa(Foo), "new Bar .isa(Foo)"); ok($bar.isa(Foo), "new Bar .isa(Foo)");


#?niecza skip 'Unable to resolve method clone in class Bar'
{ {
my $bar_clone = $bar.clone(); my $bar_clone = $bar.clone();
ok($bar_clone ~~ Bar, '... smartmatch our $bar_clone to the Bar class'); ok($bar_clone ~~ Bar, '... smartmatch our $bar_clone to the Bar class');
Expand All @@ -67,6 +70,7 @@ ok($bar.isa(Foo), "new Bar .isa(Foo)");


# Same, but with the "is Foo" declaration inlined # Same, but with the "is Foo" declaration inlined
#?rakudo skip 'not parsing is inside class yet' #?rakudo skip 'not parsing is inside class yet'
#?niecza skip 'No value for parameter \$expected in Test is'
{ {
class Baz { is Foo } class Baz { is Foo }
ok(Baz ~~ Foo, '... smartmatch our Baz to the Foo class'); ok(Baz ~~ Foo, '... smartmatch our Baz to the Foo class');
Expand Down Expand Up @@ -99,15 +103,19 @@ ok(One::Two.new, 'created One::Two after One::Two::Three');
eval_dies_ok 'class One::Two { }', 'cannot redeclare an existing class'; eval_dies_ok 'class One::Two { }', 'cannot redeclare an existing class';
eval_lives_ok q[BEGIN {class Level1::Level2::Level3 {};}; class Level1::Level2 {};], 'RT 62898'; eval_lives_ok q[BEGIN {class Level1::Level2::Level3 {};}; class Level1::Level2 {};], 'RT 62898';


class A61354_1 { #?niecza skip 'Methods must be used in some kind of package'
eval('method x { "OH HAI" }') {
}; class A61354_1 {
dies_ok { A61354_1.x }, "can't just use eval to add method to class"; eval('method x { "OH HAI" }')
};
dies_ok { A61354_1.x }, "can't just use eval to add method to class";
}


# RT #67784 # RT #67784
{ {
class class {} class class {}
#?rakudo skip 'RT #67784' #?rakudo skip 'RT #67784'
#?niecza todo
isa_ok( class.new, 'class' ); isa_ok( class.new, 'class' );
} }


Expand Down
1 change: 1 addition & 0 deletions S12-class/type-object.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ is Any.gist, 'Any()', 'Any.gist has those parens';
# maybe a bit too retrictive? # maybe a bit too retrictive?
is Any.perl, 'Any', 'Any.perl does not have parens'; is Any.perl, 'Any', 'Any.perl does not have parens';


#?niecza skip 'Unable to resolve method name in class ClassHOW'
is Any.^name, 'Any', '.^name'; is Any.^name, 'Any', '.^name';


isa_ok (class A { }).new, A, 'can instantiate return value of class declaration'; isa_ok (class A { }).new, A, 'can instantiate return value of class declaration';
1 change: 1 addition & 0 deletions S12-construction/autopairs.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plan 4;
eval_lives_ok('my $a; class Tb { has $.a }; my Tb $Tb .= new(:$a )', eval_lives_ok('my $a; class Tb { has $.a }; my Tb $Tb .= new(:$a )',
'class instantiation with autopair, spaces'); 'class instantiation with autopair, spaces');
#?rakudo 2 todo 'nom regression' #?rakudo 2 todo 'nom regression'
#?niecza 2 todo
eval_lives_ok('my $a; role Tc { has $.a }; my Tc $c .= new(:$a)', eval_lives_ok('my $a; role Tc { has $.a }; my Tc $c .= new(:$a)',
'role instantiation with autopair, no spaces'); 'role instantiation with autopair, no spaces');
eval_lives_ok('my $a; role Td { has $.a }; my Td $c .= new(:$a )', eval_lives_ok('my $a; role Td { has $.a }; my Td $c .= new(:$a )',
Expand Down
1 change: 1 addition & 0 deletions S12-enums/misc.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ use Test;
sub OK { 'sub OK' }; sub OK { 'sub OK' };
is OK, 'OK', 'enum key wins in case of conflict'; is OK, 'OK', 'enum key wins in case of conflict';
is +OK, 0, 'enum key wins in case of conflict (numeric)'; is +OK, 0, 'enum key wins in case of conflict (numeric)';
#?niecza skip 'No value for parameter $key in CORE CommonEnum.postcircumfix:<( )>'
is OK(), 'sub OK', 'but () is still a function call'; is OK(), 'sub OK', 'but () is still a function call';
is FAIL, 'FAIL', 'non-conflicting enum key'; is FAIL, 'FAIL', 'non-conflicting enum key';
is +FAIL, 1, 'non-conflicting enum key (numeric)'; is +FAIL, 1, 'non-conflicting enum key (numeric)';
Expand Down
2 changes: 2 additions & 0 deletions S12-methods/lvalue.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ is $a, 8, 'but the temp assignment had worked';
lives_ok { temp $o.l2 = 9; $b = $o.b }, lives_ok { temp $o.l2 = 9; $b = $o.b },
'can use lvalue method in temp() statement (explicit return)'; 'can use lvalue method in temp() statement (explicit return)';
is $o.l2, 4, '... and the value was reset'; is $o.l2, 4, '... and the value was reset';
#?niecza todo
is $o.b, 3, '... also on the attribute'; is $o.b, 3, '... also on the attribute';
#?niecza todo
is $a, 9, 'but the temp assignment had worked'; is $a, 9, 'but the temp assignment had worked';


# vim: ft=perl6 # vim: ft=perl6
1 change: 1 addition & 0 deletions S28-named-variables/inc.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plan 5;
# #
# L<S28/Perl5 to Perl6 special variable translation/"@*INC"> # L<S28/Perl5 to Perl6 special variable translation/"@*INC">


#?niecza todo
ok(+@*INC > 0, 'we have something in our @INC'); ok(+@*INC > 0, 'we have something in our @INC');


my $number_in_inc = +@*INC; my $number_in_inc = +@*INC;
Expand Down
4 changes: 4 additions & 0 deletions S29-context/eval.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dies_ok {eval 'use Poison; 1'}, "eval dies on fatal use";
dies_ok({eval {; 42} }, 'block eval is gone'); dies_ok({eval {; 42} }, 'block eval is gone');


# RT #63978, eval didn't work in methods # RT #63978, eval didn't work in methods
#?niecza skip 'System.IndexOutOfRangeException: Array index is out of range'
{ {
class EvalTester1 { class EvalTester1 {
method e($s) { eval $s }; method e($s) { eval $s };
Expand All @@ -44,6 +45,7 @@ dies_ok({eval {; 42} }, 'block eval is gone');
is EvalTester1.new.e('5'), 5, 'eval works inside instance methods'; is EvalTester1.new.e('5'), 5, 'eval works inside instance methods';
} }


#?niecza skip 'System.IndexOutOfRangeException: Array index is out of range'
{ {
my $x = 5; my $x = 5;
class EvalTester2 { class EvalTester2 {
Expand All @@ -56,8 +58,10 @@ dies_ok({eval {; 42} }, 'block eval is gone');
} }


#?rakudo skip 'eval(Buf)' #?rakudo skip 'eval(Buf)'
#?niecza skip 'Unable to resolve method encode in class Str'
is eval("'møp'".encode('UTF-8')), 'møp', 'eval(Buf)'; is eval("'møp'".encode('UTF-8')), 'møp', 'eval(Buf)';


#?niecza skip 'Excess arguments to CORE eval, used 1 of 3 positionals'
{ {
#?rakudo skip 'eval coerce to string' #?rakudo skip 'eval coerce to string'
is eval 88, 88, 'eval of non-string works'; is eval 88, 88, 'eval of non-string works';
Expand Down
3 changes: 3 additions & 0 deletions S32-hash/delete.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sub gen_hash {
is %h1.delete('b'), $b, "Test for delete single key."; is %h1.delete('b'), $b, "Test for delete single key.";
} }


#?niecza todo
{ {
my %h1 = gen_hash; my %h1 = gen_hash;
my @cde = %h1<c d e>; my @cde = %h1<c d e>;
Expand All @@ -32,6 +33,8 @@ is +%hash, 4, "basic sanity (2)";
is ~(%hash.delete('a')), "1", is ~(%hash.delete('a')), "1",
"deletion of a hash element returned the right value"; "deletion of a hash element returned the right value";
is +%hash, 3, "deletion of a hash element"; is +%hash, 3, "deletion of a hash element";

#?niecza skip 'Excess arguments to CORE Hash.delete, used 2 of 3 positionals'
{ {
is ~(%hash.delete("c", "d")), "3 4", is ~(%hash.delete("c", "d")), "3 4",
"deletion of hash elements returned the right values"; "deletion of hash elements returned the right values";
Expand Down
3 changes: 3 additions & 0 deletions S32-hash/invert.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ plan 5;


{ {
my %h = a => 'b', c => 'd'; my %h = a => 'b', c => 'd';
#?niecza todo
isa_ok %h.invert, List, 'Hash.invert returns a List'; isa_ok %h.invert, List, 'Hash.invert returns a List';
#?niecza skip 'Cannot use value like Pair as a number'
is_deeply %h.invert.sort, (b => 'a', d => 'c'), 'simple Hash.invert works'; is_deeply %h.invert.sort, (b => 'a', d => 'c'), 'simple Hash.invert works';
is_deeply %h, { a => 'b', c => 'd' }, 'original remains unchanged'; is_deeply %h, { a => 'b', c => 'd' }, 'original remains unchanged';
} }
Expand All @@ -16,6 +18,7 @@ plan 5;
# with lists # with lists
my %h = a => <b c>, d => 'e'; my %h = a => <b c>, d => 'e';
#?rakudo todo 'nom regression' #?rakudo todo 'nom regression'
#?niecza skip 'Cannot use value like Pair as a number'
is_deeply %h.invert.sort, (b => 'a', c => 'a', e => 'd'), is_deeply %h.invert.sort, (b => 'a', c => 'a', e => 'd'),
'Hash.invert flattens list values'; 'Hash.invert flattens list values';
is_deeply %h, {a => <b c>, d => 'e'}, 'original remains unchanged'; is_deeply %h, {a => <b c>, d => 'e'}, 'original remains unchanged';
Expand Down
4 changes: 4 additions & 0 deletions S32-hash/keys_values.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ is(+%hash.values, +%hash, 'we have the same number of keys as elements in the ha


# keys and values on Pairs # keys and values on Pairs
my $pair = (a => 42); my $pair = (a => 42);
#?niecza todo
is(~$pair.keys, "a", '$pair.keys works'); is(~$pair.keys, "a", '$pair.keys works');
#?niecza todo
is(~keys($pair), "a", 'keys($pair) works'); is(~keys($pair), "a", 'keys($pair) works');
is($pair.keys.elems, 1, 'we have one key'); is($pair.keys.elems, 1, 'we have one key');


#?niecza todo
is(~$pair.values, 42, '$pair.values works'); is(~$pair.values, 42, '$pair.values works');
#?niecza todo
is(~values($pair), 42, 'values($pair) works'); is(~values($pair), 42, 'values($pair) works');
is($pair.values.elems, 1, 'we have one value'); is($pair.values.elems, 1, 'we have one value');


Expand Down
2 changes: 2 additions & 0 deletions S32-hash/pairs.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Basic C<pairs> tests, see S32::Containers.
my %hash = (a => 1, b => 2, c => 3); my %hash = (a => 1, b => 2, c => 3);
my @pairs; my @pairs;
ok((@pairs = %hash.pairs), "pairs on hashes"); ok((@pairs = %hash.pairs), "pairs on hashes");
#?niecza skip 'Cannot use value like Pair as a number'
ok((@pairs = @pairs.sort), 'Can sort list of pairs'); ok((@pairs = @pairs.sort), 'Can sort list of pairs');
is +@pairs, 3, "pairs on hashes returned the correct number of elems"; is +@pairs, 3, "pairs on hashes returned the correct number of elems";
if +@pairs != 3 { if +@pairs != 3 {
Expand Down Expand Up @@ -45,6 +46,7 @@ Basic C<pairs> tests, see S32::Containers.
} }


# This next group added by Darren Duncan following discovery while debugging ext/Locale-KeyedText: # This next group added by Darren Duncan following discovery while debugging ext/Locale-KeyedText:
#?niecza skip 'Cannot use value like Pair as a number'
{ {
my $hash_of_2_pairs = {'a'=>'b','c'=>'d'}; my $hash_of_2_pairs = {'a'=>'b','c'=>'d'};
my $hash_of_1_pair = {'a'=>'b'}; my $hash_of_1_pair = {'a'=>'b'};
Expand Down
7 changes: 7 additions & 0 deletions S32-hash/slice.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ plan 29;
is(%hash{@slice[0,1]}, (4,6), "slice from array slice, part 2"); is(%hash{@slice[0,1]}, (4,6), "slice from array slice, part 2");
} }


#?niecza skip 'Excess arguments to CORE List.new, used 1 of 3 positionals'
{ my %hash; { my %hash;


%hash{(1,2)} = "one", "two"; %hash{(1,2)} = "one", "two";
Expand All @@ -47,6 +48,7 @@ plan 29;


#?pugs todo 'feature' #?pugs todo 'feature'
#?rakudo skip 'binding on hash elements unimplemented' #?rakudo skip 'binding on hash elements unimplemented'
#?niecza skip 'Writing to readonly scalar'
{ {
my %hash = :a(1), :b(2), :c(3), :d(4); my %hash = :a(1), :b(2), :c(3), :d(4);
my @slice := %hash<b c>; my @slice := %hash<b c>;
Expand Down Expand Up @@ -77,6 +79,7 @@ Quoting Larry:


try { %hash<a b> := <FOO BAR> }; try { %hash<a b> := <FOO BAR> };
#?pugs 2 todo 'bug' #?pugs 2 todo 'bug'
#?niecza 2 todo
is %hash<a>, "FOO", "binding hash slices works (1-1)"; is %hash<a>, "FOO", "binding hash slices works (1-1)";
is %hash<b>, "BAR", "binding hash slices works (1-2)"; is %hash<b>, "BAR", "binding hash slices works (1-2)";
} }
Expand All @@ -86,6 +89,7 @@ Quoting Larry:


try { %hash<a b> := <FOO> }; try { %hash<a b> := <FOO> };
#?pugs 2 todo 'bug' #?pugs 2 todo 'bug'
#?niecza 2 todo
is %hash<a>, "FOO", "binding hash slices works (2-1)"; is %hash<a>, "FOO", "binding hash slices works (2-1)";
ok !defined(%hash<b>), "binding hash slices works (2-2)"; ok !defined(%hash<b>), "binding hash slices works (2-2)";
} }
Expand All @@ -97,11 +101,13 @@ Quoting Larry:


try { %hash<a b> := ($foo, $bar) }; try { %hash<a b> := ($foo, $bar) };
#?pugs 2 todo 'bug' #?pugs 2 todo 'bug'
#?niecza 2 todo
is %hash<a>, "FOO", "binding hash slices works (3-1)"; is %hash<a>, "FOO", "binding hash slices works (3-1)";
is %hash<b>, "BAR", "binding hash slices works (3-2)"; is %hash<b>, "BAR", "binding hash slices works (3-2)";


$foo = "BB"; $foo = "BB";
$bar = "CC"; $bar = "CC";
#?niecza 2 todo
#?pugs 2 todo 'bug' #?pugs 2 todo 'bug'
is %hash<a>, "BB", "binding hash slices works (3-3)"; is %hash<a>, "BB", "binding hash slices works (3-3)";
is %hash<b>, "CC", "binding hash slices works (3-4)"; is %hash<b>, "CC", "binding hash slices works (3-4)";
Expand All @@ -111,6 +117,7 @@ Quoting Larry:
is %hash<a>, "BBB", "binding hash slices works (3-5)"; is %hash<a>, "BBB", "binding hash slices works (3-5)";
is %hash<b>, "CCC", "binding hash slices works (3-6)"; is %hash<b>, "CCC", "binding hash slices works (3-6)";
#?pugs 2 todo 'bug' #?pugs 2 todo 'bug'
#?niecza 2 todo
is $foo, "BBB", "binding hash slices works (3-7)"; is $foo, "BBB", "binding hash slices works (3-7)";
is $bar, "CCC", "binding hash slices works (3-8)"; is $bar, "CCC", "binding hash slices works (3-8)";
} }
Expand Down
1 change: 1 addition & 0 deletions S32-list/first.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ my @list = (1 ... 10);
} }


#?rakudo skip "adverbial block" #?rakudo skip "adverbial block"
#?niecza skip 'No value for parameter Mu $filter in CORE Any.first'
{ {
my $result = @list.first():{ ($^a == 4) }; my $result = @list.first():{ ($^a == 4) };
ok($result ~~ Int, "first():<block> returns an Int"); ok($result ~~ Int, "first():<block> returns an Int");
Expand Down
Loading

0 comments on commit 3a7da94

Please sign in to comment.