Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure we test Set(Hash).kv (correctly)
  • Loading branch information
lizmat committed Oct 6, 2015
1 parent e2a621c commit 9c5c7a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion S02-types/set.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 173;
plan 174;

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

Expand Down Expand Up @@ -401,4 +401,9 @@ dies-ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';
'trying to assign throws X::Assignment::RO';
}

{
my $a = (1,2,3,2,2,2,2).Set;
is $a.kv.sort, (1,2,3,True,True,True), "Set.kv returns list of keys and values";
}

# vim: ft=perl6
3 changes: 1 addition & 2 deletions S02-types/sethash.t
Expand Up @@ -70,10 +70,9 @@ sub showset($s) { $s.keys.sort.join(' ') }

{
my $a = (1,2,3,2,2,2,2).SetHash;
is $a.kv.sort, ((1, Bool::True), (2, Bool::True), (3, Bool::True)).list.sort, "SetHash.kv returns list of keys and values";
is $a.kv.sort, (1,2,3,True,True,True), "SetHash.kv returns list of keys and values";
}


{
ok (SetHash.new: <a b c>) ~~ (SetHash.new: <a b c>), "Identical sets smartmatch with each other";
nok (SetHash.new: <b c>) ~~ (SetHash.new: <a b c>), "Subset does not smartmatch";
Expand Down

0 comments on commit 9c5c7a3

Please sign in to comment.