Skip to content

Commit

Permalink
Add tests for Set.grab(N)
Browse files Browse the repository at this point in the history
They should all die!
  • Loading branch information
lizmat committed May 21, 2017
1 parent 4dfee69 commit b1bf692
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions S02-types/set.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 197;
plan 204;

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

Expand Down Expand Up @@ -294,7 +294,7 @@ dies-ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';
-1, '-1',
-Inf, '-Inf'
-> $p, $t {
is-deeply set().pick($p), ().Seq, "empty set.rpick($t) -> ().Seq"
is-deeply set().pick($p), ().Seq, "empty set.pick($t) -> ().Seq"
}
dies-ok { set().pick(NaN) }, 'empty set.pick(NaN) should die';
}
Expand All @@ -304,6 +304,18 @@ dies-ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';
{
my $s = set <a b c>;
dies-ok { $s.grab }, 'cannot call .grab on a Set';

for
1, '1',
*-1, '*-1',
*, '*',
Inf, 'Inf',
-1, '-1',
-Inf, '-Inf',
NaN, 'NaN'
-> $p, $t {
dies-ok { $s.grab($p) }, "cannot call .grab($t) on a Set"
}
}

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

0 comments on commit b1bf692

Please sign in to comment.