autocurry tests
[p5sagit/Function-Parameters.git] / t / rename.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 use Function::Parameters 'f';
6
7 my $add = f ($x, $y) { $x + $y };
8
9 is $add->(2, 4), 6;
10
11 ok !eval { Function::Parameters->import('g', 'h'); 1 };
12 like $@, qr/ is not exported /;
13
14 for my $kw ('', '42', 'A::B', 'a b') {
15         ok !eval{ Function::Parameters->import($kw); 1 };
16         like $@, qr/valid identifier /;
17 }
18
19 done_testing;