Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests for .grabpairs where they are not supposed to work
  • Loading branch information
lizmat committed Oct 6, 2013
1 parent 5b439fa commit af7277f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
11 changes: 10 additions & 1 deletion S02-types/bag.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 159;
plan 160;

sub showkv($x) {
$x.keys.sort.map({ $^k ~ ':' ~ $x{$k} }).join(' ')
Expand Down Expand Up @@ -324,6 +324,15 @@ sub showkv($x) {
dies_ok { $b.grab }, 'cannot call .grab on a Bag';
}

# L<S32::Containers/Bag/grabpairs>

#?pugs skip '.grabpairs NYI'
#?niecza skip '.grabpairs NYI'
{
my $b = bag <a b b c c c>;
dies_ok { $b.grabpairs }, 'cannot call .grabpairs on a Bag';
}

{
my $b1 = bag ( bag <a b c> ), <c c c d d d d>;
is +$b1, 8, "Three elements";
Expand Down
11 changes: 10 additions & 1 deletion S02-types/mix.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 150;
plan 151;

sub showkv($x) {
$x.keys.sort.map({ $^k ~ ':' ~ $x{$k} }).join(' ')
Expand Down Expand Up @@ -297,6 +297,15 @@ sub showkv($x) {
dies_ok { $m.grab }, 'cannot call .grab on a Mix';
}

# L<S32::Containers/Mix/grabpairs>

#?pugs skip '.grabpairs NYI'
#?niecza skip '.grabpairs NYI'
{
my $m = mix <a b b c c c>;
dies_ok { $m.grabpairs }, 'cannot call .grabpairs on a Mix';
}

{
my $m1 = mix ( mix <a b c> ), <c c c d d d d>;
is +$m1, 8, "Three elements";
Expand Down
11 changes: 10 additions & 1 deletion S02-types/set.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 150;
plan 151;

sub showset($s) { $s.keys.sort.join(' ') }

Expand Down Expand Up @@ -292,6 +292,15 @@ sub showset($s) { $s.keys.sort.join(' ') }
dies_ok { $s.grab }, 'cannot call .grab on a Set';
}

# L<S32::Containers/Set/grabpairs>

#?pugs skip '.grabpairs NYI'
#?niecza skip '.grabpairs NYI'
{
my $s = set <a b c>;
dies_ok { $s.grabpairs }, 'cannot call .grabpairs on a Set';
}

# RT 107022
{
my $s1 = set ( set <a b c> ), <c d>;
Expand Down

0 comments on commit af7277f

Please sign in to comment.