add begin.t from Method::Signatures
[p5sagit/Function-Parameters.git] / t / defaults_regress.t
CommitLineData
63915d26 1#!perl
2
3use Test::More tests => 3;
4
5use warnings FATAL => 'all';
6use strict;
7
8use 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}