import all tests from Fun
[p5sagit/Function-Parameters.git] / t / foreign / Fun / basic.t
CommitLineData
98478aff 1#!perl
2use strict;
3use warnings FATAL => 'all';
4use Test::More;
5
6use Function::Parameters;
7
8fun mul ($x, $y) {
9 return $x * $y;
10}
11
12is(mul(3, 4), 12);
13
14fun sum (@nums) {
15 my $sum;
16 for my $num (@nums) {
17 $sum += $num;
18 }
19 return $sum;
20}
21
22is(sum(1, 2, 3, 4), 10);
23
24{
25 package Foo;
26 use Function::Parameters;
27 fun foo { }
28}
29
30ok(exists $Foo::{foo});
31
32done_testing;