Skip to content

Commit

Permalink
Merge pull request #379 from lefth/test-for-1438
Browse files Browse the repository at this point in the history
Add a test for picking a Bag with an argument smaller than the Bag size.
  • Loading branch information
zoffixznet committed Jan 23, 2018
2 parents d1900a8 + d5c1b77 commit 0047ed7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion S02-types/bag.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 233;
plan 234;

sub showkv($x) {
$x.keys.sort.map({ $^k ~ ':' ~ $x{$k} }).join(' ')
Expand Down Expand Up @@ -316,6 +316,8 @@ sub showkv($x) {
@a = $b.pick(-2.5);
is +@a, 0, '.pick(<negative number>) does not return any items';

lives-ok { $b.pick(1).gist },
".pick() gives valid result with argument"; # https://github.com/rakudo/rakudo/issues/1438
lives-ok { @a = $b.pick(2.5) }, ".pick int-ifies arg"; # RT #131272
}

Expand Down

0 comments on commit 0047ed7

Please sign in to comment.