Commit | Line | Data |
---|---|---|
595edbcf | 1 | #!perl |
2 | use strict; | |
3 | use warnings FATAL => 'all'; | |
4 | use Test::More; | |
5 | use Test::Fatal; | |
6 | ||
7 | { | |
8 | package Foo; | |
9 | use Function::Parameters qw(:strict); | |
10 | method new($class:) { bless {}, $class } | |
11 | method bar { 42 } | |
12 | } | |
13 | ||
14 | my $foo = Foo->new; | |
15 | ||
16 | is(exception { | |
17 | $foo->bar | |
18 | }, undef, 'method without signature succeeds when called without args'); | |
19 | ||
20 | is(exception { | |
21 | $foo->bar(42) | |
22 | }, undef, 'method without signature succeeds when called with args'); | |
23 | ||
24 | done_testing; |