Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[t/spec/S13-overloading/typecasting-long.t] align the test with the s…

…pec, should result in some failures...

git-svn-id: http://svn.pugscode.org/pugs@28063 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit f6386b1d1d153ad34124561e59ff197a5ae33620 1 parent 75b351c
ruoso authored
Showing with 14 additions and 3 deletions.
  1. +14 −3 S13-overloading/typecasting-long.t
View
17 S13-overloading/typecasting-long.t
@@ -7,13 +7,24 @@ plan 14;
# basic tests to see if the methods overload correctly.
{
+ my multi testsub ($a,$b) {
+ return 1;
+ }
+ my multi testsub ($a) {
+ return 2;
+ }
+ my multi testsub () {
+ return 3;
+ }
class TypeCastSub {
- method postcircumfix:<( )> () {return 'pretending to be a sub'}
+ method postcircumfix:<( )> ($capture) {return 'pretending to be a sub '.testsub(|$capture) }
}
my $thing = TypeCastSub.new;
- is($thing(), 'pretending to be a sub', 'overloaded () call works');
- is($thing.(), 'pretending to be a sub', 'overloaded .() call works');
+ is($thing(), 'pretending to be a sub 3', 'overloaded () call works');
+ is($thing.(), 'pretending to be a sub 3', 'overloaded .() call works');
+ is($thing.(1), 'pretending to be a sub 2', 'overloaded .() call works');
+ is($thing.(1,2), 'pretending to be a sub 1', 'overloaded .() call works');
}
{
Please sign in to comment.
Something went wrong with that request. Please try again.