Skip to content

Commit

Permalink
Make too specific error checking less specific
Browse files Browse the repository at this point in the history
Checking for a X::Multi::NoMatch is a code smell anyway, as that error
message can be very confusing and on the border of LTA, especially for
newbies.
  • Loading branch information
lizmat authored and Altai-man committed Jun 20, 2020
1 parent 9ada793 commit c0c3edb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion S32-io/io-path.t
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ subtest '.parent(Int)' => {

for @paths -> $p is raw {
my $d := $p.perl;
throws-like { $p.parent(-1) }, X::Multi::NoMatch, 'no candidate to handle negative parents';
dies-ok { $p.parent(-1) }, 'negative parents handled ok';
is-deeply $p.parent(0), $p, "0 $d";
is-deeply $p.parent(1), $p.parent, "1 $d";
is-deeply $p.parent(2), $p.parent.parent, "2 $d";
Expand Down

0 comments on commit c0c3edb

Please sign in to comment.