Skip to content

Commit

Permalink
Fudges / unfudges while working on Set
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 4, 2013
1 parent b4311be commit 1d1e315
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions S02-types/keybag.t
Expand Up @@ -77,6 +77,7 @@ sub showkv($x) {
nok "a" ~~ (KeyBag.new: <a b c>), "Smartmatch is not element of";
ok (KeyBag.new: <a b c>) ~~ KeyBag, "Type-checking smartmatch works";

#?rakudo todo 'huh?'
ok (set <a b c>) ~~ (KeyBag.new: <a b c>), "Set smartmatches with equivalent KeyBag.new:";
nok (set <a a a b c>) ~~ (KeyBag.new: <a a a b c>), "... but not if the Bag has greater quantities";
nok (set <a b c>) ~~ KeyBag, "Type-checking smartmatch works";
Expand Down
2 changes: 0 additions & 2 deletions S02-types/set.t
Expand Up @@ -86,7 +86,6 @@ sub showset($s) { $s.keys.sort.join(' ') }
my $s = set 2, 'a', False;
my @ks = $s.keys;
#?niecza 3 todo
#?rakudo 3 todo ''
is @ks.grep(Int)[0], 2, 'Int keys are left as Ints';
is @ks.grep(* eqv False).elems, 1, 'Bool keys are left as Bools';
is @ks.grep(Str)[0], 'a', 'And Str keys are permitted in the same set';
Expand Down Expand Up @@ -287,7 +286,6 @@ sub showset($s) { $s.keys.sort.join(' ') }
ok $s1<c>, "One of them is 'c'";
ok $s1<d>, "One of them is 'd'";
$inner-set = $s1.first(Set);
#?rakudo 2 todo "Set does not conform to new standard yet"
#?niecza 2 todo 'Set in Set does not work correctly yet'
isa_ok $inner-set, Set, "One of the set's elements is indeed a set!";
is showset($inner-set), "a b c", "With the proper elements";
Expand Down
4 changes: 4 additions & 0 deletions S03-operators/bag.t
Expand Up @@ -42,17 +42,21 @@ isa_ok ($b ∩ $b), Bag, "... and it's actually a Bag";
is showkv($kb $kb), showkv($kb), "KeyBag intersection with itself yields self (as Bag)";
isa_ok ($kb $kb), Bag, "... and it's actually a Bag";

#?rakudo todo 'huh?'
is showkv($s $b), "blood:1 love:1", "Set intersection with Bag works";
isa_ok ($s $b), Bag, "... and it's actually a Bag";
#?rakudo todo 'huh?'
is showkv($s $kb), "blood:1 love:1", "Set intersection with KeyBag works";
isa_ok ($s $kb), Bag, "... and it's actually a Bag";
#?niecza todo 'Right now this works as $kb ∩ glag ∩ green ∩ blood. Test may be wrong'
#?rakudo todo 'Right now this works as $kb ∩ glag ∩ green ∩ blood. Test may be wrong'
is showkv($kb <glad green blood>), "blood:1", "KeyBag intersection with array of strings works";
isa_ok ($kb <glad green blood>), Bag, "... and it's actually a Bag";

#?rakudo todo 'huh?'
is showkv($s (&) $b), "blood:1 love:1", "Set intersection with Bag works (texas)";
isa_ok ($s (&) $b), Bag, "... and it's actually a Bag";
#?rakudo todo 'huh?'
is showkv($s (&) $kb), "blood:1 love:1", "Set intersection with KeyBag works (texas)";
isa_ok ($s (&) $kb), Bag, "... and it's actually a Bag";
#?niecza todo 'Right now this works as $kb ∩ glag ∩ green ∩ blood. Test may be wrong?'
Expand Down
4 changes: 2 additions & 2 deletions S03-operators/set.t
Expand Up @@ -140,10 +140,10 @@ isa_ok ($s (^) $ks), Set, "... and it's actually a Set";
is showset($ks (^) $s), showset(set <is isn't your day>), "Set symmetric difference with KeySet is correct";
isa_ok ($ks (^) $s), Set, "... and it's actually a Set";

#?rakudo todo 'huh?'
#?rakudo skip 'huh?'
is showset($s (^) $b), showset($s (|) $b), "Bag symmetric difference with Set is correct";
isa_ok ($s (^) $b), Set, "... and it's actually a Set";
#?rakudo todo 'huh?'
#?rakudo skip 'huh?'
is showset($b (^) $s), showset($s (|) $b), "Set symmetric difference with Bag is correct";
isa_ok ($b (^) $s), Set, "... and it's actually a Set";

Expand Down

0 comments on commit 1d1e315

Please sign in to comment.