Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use is-deeply to compare Sets
Sets are unordered, so stringifying a Set can give any result. `is`
test routine just compares strings. Use `is-deeply` instead to make
sure that the test is successful independent from the stringification
order (which is randomized in newer Rakudos).
  • Loading branch information
AlexDaniel committed Jul 12, 2018
1 parent c4da3e6 commit a485038
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/01-domain.t
Expand Up @@ -7,15 +7,15 @@ use ProblemSolver::Domain;
my $d = ProblemSolver::Domain[1, 2, 3].new;
ok $d, "Instanciated a Domain";

is $d.pos, set(1, 2, 3), "Domain with the right possibilities";
is-deeply $d.pos, set(1, 2, 3), "Domain with the right possibilities";
is $d.elems, 3, "Domain with the right number of possibilities";
my $new = $d.find-and-remove: * == 3;
isnt $new, $d, "find-and-remove return a different obj";
is $new.pos, set(1, 2), "Domain with the right possibilities";
is-deeply $new.pos, set(1, 2), "Domain with the right possibilities";
is $new.elems, 2, "Domain with the right number of possibilities";
$d = $new.remove: 2;
isnt $d, $new, "find-and-remove return a different obj";
is $d.pos, set(1), "Domain with the right possibilities";
is-deeply $d.pos, set(1), "Domain with the right possibilities";
is $d.elems, 1, "Domain with the right number of possibilities";

done-testing;

0 comments on commit a485038

Please sign in to comment.