File: rename.t

package info (click to toggle)
libfunction-parameters-perl 2.002005-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 624 kB
  • sloc: perl: 3,945; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings;
use Test::More;

use Function::Parameters { f => 'function' };

my $add = f ($x, $y) { $x + $y };

is $add->(2, 4), 6;

use Function::Parameters {
    meth_b => 'method',
    func_b => 'function',
};

func_b cat_b($x, $y) {
    $x . $y
}

meth_b tac_b($x) {
    $x . $self
}

is cat_b('ab', 'cde'), 'abcde';
is tac_b('ab', 'cde'), 'cdeab';

done_testing;