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 | ||
1a52f2db | 11 | method new($class:) { bless {}, $class } |
595edbcf | 12 | method foo ($bar) { $bar } |
13 | } | |
14 | ||
15 | my $o = Foo->new; | |
16 | is(exception { $o->foo(42) }, undef); | |
17 | like(exception { $o->foo(42, 23) }, qr/Too many arguments/); | |
18 | ||
19 | done_testing; |