Skip to content

Commit

Permalink
Add test for RT #117773
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Oct 15, 2014
1 parent 658c960 commit 502f2ca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions S02-types/baghash.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 249;
plan 250;

# L<S02/Mutable types/QuantHash of UInt>

Expand Down Expand Up @@ -31,7 +31,7 @@ sub showkv($x) {
is ([+] $b.values), 8, "Values returns the correct sum";
ok ?$b, "Bool returns True if there is something in the BagHash";
nok ?BagHash.new(), "Bool returns False if there is nothing in the BagHash";

my $hash;
lives_ok { $hash = $b.hash }, ".hash doesn't die";
isa_ok $hash, Hash, "...and it returned a Hash";
Expand Down Expand Up @@ -59,7 +59,7 @@ sub showkv($x) {
nok $b<spiderman>:exists, "... and that didn't create the element";
lives_ok { $b<brady> = 0 }, "Can assign zero to a existing element";
nok $b<brady>:exists, "... and it goes away";

lives_ok { $b<a>++ }, "Can ++ an existing element";
is $b<a>, 43, "... and the increment happens";
lives_ok { $b<carter>++ }, "Can ++ a new element";
Expand Down Expand Up @@ -551,3 +551,9 @@ sub showkv($x) {
is $e.fmt('%s foo %s'), "", '.fmt(%s%s) works (empty)';
is $e.fmt('%s,%s',':'), "", '.fmt(%s%s,sep) works (empty)';
}

# RT #117773
{
my $b = BagHash.new( (a=>"b") );
ok $b.keys[0] ~~ ("a" => "b"), 'first key of BagHash is a Pair ("a" => "b")';
}

0 comments on commit 502f2ca

Please sign in to comment.