Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some test adaptations because of Baggy streamline
  • Loading branch information
lizmat committed Oct 20, 2014
1 parent 3c20f45 commit 01feaf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 3 additions & 5 deletions S02-types/bag.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 198;
plan 196;

sub showkv($x) {
$x.keys.sort.map({ $^k ~ ':' ~ $x{$k} }).join(' ')
Expand Down Expand Up @@ -348,10 +348,8 @@ sub showkv($x) {
my $b = Bag.new("a", "b", "b");

my $a = $b.pickpairs;
isa_ok $a, List, 'Did we get a List';
is $a.elems, 1, 'Did we get one element';
isa_ok $a[0], Pair, 'Did we get a Pair in the List';
ok ($a[0] eq "a\t1" or $a[0] eq "b\t2"), "We got one of the two choices";
isa_ok $a, Pair, 'Did we get a Pair';
ok ($a eq "a\t1" or $a eq "b\t2"), "We got one of the two choices";

my @a = $b.pickpairs(2);
is +@a, 2, '.pickpairs(2) returns the right number of items';
Expand Down
10 changes: 3 additions & 7 deletions S02-types/baghash.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 252;
plan 250;

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

Expand Down Expand Up @@ -336,10 +336,8 @@ sub showkv($x) {

my $a = $b.pickpairs;
say :$a.perl;
isa_ok $a, List, 'Did we get a List';
is $a.elems, 1, 'Did we get one element';
isa_ok $a[0], Pair, 'Did we get a Pair in the List';
ok ($a[0] eq "a\t1" or $a[0] eq "b\t2"), "We got one of the two choices";
isa_ok $a, Pair, 'Did we get a Pair';
ok ($a eq "a\t1" or $a eq "b\t2"), "We got one of the two choices";

my @a = $b.pickpairs(2);
is +@a, 2, '.pickpairs(2) returns the right number of items';
Expand Down Expand Up @@ -368,7 +366,6 @@ sub showkv($x) {
is @a.grep(* eq 'b').elems, 2 - @a.grep(* eq 'a').elems, '.grab(2) and the rest are "b"';
is $b.total, 0, '.grab *should* change BagHash';
#?rakudo.jvm todo "RT #120407"
#?rakudo.moar todo "RT #120407"
is $b.elems, 0, '.grab *should* change BagHash';
}

Expand All @@ -381,7 +378,6 @@ sub showkv($x) {
is @a.grep(* eq 'b').elems, 2, '.grab(*) (2)';
is $b.total, 0, '.grab *should* change BagHash';
#?rakudo.jvm todo "RT #120407"
#?rakudo.moar todo "RT #120407"
is $b.elems, 0, '.grab *should* change BagHash';
}

Expand Down

0 comments on commit 01feaf8

Please sign in to comment.