Skip to content

Commit

Permalink
Add test for no private methods are suggested
Browse files Browse the repository at this point in the history
When a call is made outisde of a class body suggesting private methods
for a missing call is undesirable.
  • Loading branch information
vrurg committed Jul 23, 2020
1 parent acc5e64 commit 4546a60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/05-messages/01-errors.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use lib <t/packages/>;
use Test;
use Test::Helpers;

plan 50;
plan 51;

# https://github.com/Raku/old-issue-tracker/issues/5707
throws-like '1++', X::Multi::NoMatch,
Expand Down Expand Up @@ -220,6 +220,10 @@ throws-like { Blob.splice }, X::Multi::NoMatch,
X::Method::NotFound,
message => all(/<<"No such private method '!bar'" \W/, /<<'RT123078_2'>>/, /<<'bar'>>/, /<<'baz'>>/),
'a public method of the same name as the missing private method is suggested';
throws-like q| class RT123078_3 { method !bar { }; method baz { } }; RT123078_3.new.bar |,
X::Method::NotFound,
message => all(/<<"No such method 'bar'" \W/, /<<'RT123078_3'>>/, /\s+ Did \s+ you \s+ mean \s+ "'baz'"/),
'a private method of the same name as the public missing method is not suggested for out-of-class call';
throws-like q| <a a b>.uniq |,
X::Method::NotFound,
message => all(/<<"No such method 'uniq'" \W/, /<<'unique'>>/),
Expand Down

0 comments on commit 4546a60

Please sign in to comment.