Skip to content

Commit

Permalink
Removed superfluous (^) tests
Browse files Browse the repository at this point in the history
All these cases are being handled by set_symmetric_difference.t now
  • Loading branch information
lizmat committed Jul 13, 2017
1 parent 5833e26 commit 2450d64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 42 deletions.
18 changes: 2 additions & 16 deletions S03-operators/bag.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 54;
plan 46;

sub showset($s) { $s.keys.sort.join(' ') }
sub showkv($x) { $x.sort.map({ .key ~ ':' ~ .value }).join(' ') }
Expand All @@ -21,21 +21,7 @@ my $kb = BagHash.new(<blood love love>);

# Bag Intersection tests moved to set_intersection.t

# symmetric difference

sub symmetric-difference($a, $b) {
($a (|) $b) (-) ($b (&) $a)
}

is showkv($s (^) $b), showkv(symmetric-difference($s, $b)), "Bag symmetric difference with Set is correct";
isa-ok ($s (^) $b), Bag, "... and it's actually a Bag";
is showkv($b (^) $s), showkv(symmetric-difference($s, $b)), "Set symmetric difference with Bag is correct";
isa-ok ($b (^) $s), Bag, "... and it's actually a Bag";

is showkv($s (^) $kb), showkv(symmetric-difference($s, $kb)), "BagHash symmetric difference with Set is correct";
isa-ok ($s (^) $kb), Bag, "... and it's actually a Bag";
is showkv($kb (^) $s), showkv(symmetric-difference($s, $kb)), "Set symmetric difference with BagHash is correct";
isa-ok ($kb (^) $s), Bag, "... and it's actually a Bag";
# symmetric difference moved to set_symmetric_difference.t

# Bag multiplication tests moved to set_multiply.t

Expand Down
18 changes: 2 additions & 16 deletions S03-operators/mix.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 66;
plan 58;

sub showset($b) { $b.keys.sort.join(' ') }
sub showkv($x) { $x.sort.map({ .key ~ ':' ~ .value }).join(' ') }
Expand All @@ -21,21 +21,7 @@ my $mh = MixHash.new-from-pairs("blood" => 1.1, "love" => 1.3);

# Mix Intersection tests moved to set_intersection.t

# symmetric difference

sub symmetric-difference($a, $m) {
($a (|) $m) (-) ($m (&) $a)
}

is ($b (^) $m), symmetric-difference($b, $m), "Mix symmetric difference with Bag is correct";
isa-ok ($b (^) $m), Mix, "... and it's actually a Mix";
is ($m (^) $b), symmetric-difference($b, $m), "Bag symmetric difference with Mix is correct";
isa-ok ($m (^) $b), Mix, "... and it's actually a Mix";

is ($b (^) $mh), symmetric-difference($b, $mh), "MixHash symmetric difference with Bag is correct";
isa-ok ($b (^) $mh), Mix, "... and it's actually a Mix";
is ($mh (^) $b), symmetric-difference($b, $mh), "Bag symmetric difference with MixHash is correct";
isa-ok ($mh (^) $b), Mix, "... and it's actually a Mix";
# symmetric difference tests moved to set_symmetric_difference.t

# Mix multiplication tests moved to set_multiply.t

Expand Down
12 changes: 2 additions & 10 deletions S03-operators/set.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 26;
plan 20;

sub showset($s) { $s.keys.sort.join(' ') }
sub showkv($x) { $x.sort.map({ .key ~ ':' ~ .value }).join(' ') }
Expand All @@ -17,15 +17,7 @@ my $bh = BagHash.new(<Come, take your bread with joy, and your wine with a glad

# set subtraction moved to difference.t

# symmetric difference

is showset($s (^) $s), showset(∅), "Set symmetric difference with Set is correct";
isa-ok ($s (^) $s), Set, "... and it's actually a Set";

is showset($s (^) $sh), showset(set <is isn't your day>), "SetHash symmetric difference with Set is correct";
isa-ok ($s (^) $sh), Set, "... and it's actually a Set";
is showset($sh (^) $s), showset(set <is isn't your day>), "Set symmetric difference with SetHash is correct";
isa-ok ($sh (^) $s), Set, "... and it's actually a Set";
# symmetric difference moved to set_symmetric_difference.t

# RT #122882
is showset($s (^) $s (^) $s), showset(∅), "Set symmetric difference with 3+ args (RT #122882)";
Expand Down

0 comments on commit 2450d64

Please sign in to comment.