projects
/
p5sagit/Function-Parameters.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
import more Method::Signatures tests
[p5sagit/Function-Parameters.git]
/
t
/
foreign
/
Fun
/
basic.t
1
#!perl
2
use strict;
3
use warnings FATAL => 'all';
4
use Test::More;
5
6
use Function::Parameters;
7
8
fun mul ($x, $y) {
9
return $x * $y;
10
}
11
12
is(mul(3, 4), 12);
13
14
fun sum (@nums) {
15
my $sum;
16
for my $num (@nums) {
17
$sum += $num;
18
}
19
return $sum;
20
}
21
22
is(sum(1, 2, 3, 4), 10);
23
24
{
25
package Foo;
26
use Function::Parameters;
27
fun foo { }
28
}
29
30
ok(exists $Foo::{foo});
31
32
done_testing;