add begin.t from Method::Signatures
[p5sagit/Function-Parameters.git] / t / defaults_regress.t
1 #!perl
2
3 use Test::More tests => 3;
4
5 use warnings FATAL => 'all';
6 use strict;
7
8 use Function::Parameters {
9         fun => {
10                 default_arguments => 1,
11         },
12 };
13
14 {
15         my ($d0, $d1, $d2, $d3);
16         my $default = 'aaa';
17
18         fun padness($x = $default++) {
19                 return $x;
20         }
21
22         is padness('unrelated'), 'unrelated';
23         is &padness(), 'aaa';
24         is padness, 'aab';
25 }