3 use Test::More tests => 10;
5 use warnings FATAL => 'all';
8 use Function::Parameters { clathod => 'classmethod' };
10 clathod id_1() { $class }
28 ) ##AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
37 clathod mymap(@args) :(&@) {
40 push @res, $class->($_);
46 $class < 2 ? 1 : $class * fac_1 $class - 1
49 clathod fac_2() :($) {
50 $class < 2 ? 1 : $class * fac_2 $class - 1
54 ok id_1(1), 'basic sanity';
55 ok id_2 1, 'simple prototype';
56 ok id_3(1), 'definition over multiple lines';
57 is add(2, 2), 4, '2 + 2 = 4';
58 is add(39, 3), 42, '39 + 3 = 42';
59 is_deeply [mymap { $_ * 2 } 2, 3, 5, 9], [4, 6, 10, 18], 'mymap works';
60 is fac_1(5), 120, 'fac_1';
61 is fac_2 6, 720, 'fac_2';
62 is clathod ($y) { $class . $y }->(clathod () { $class + 1 }->(3), clathod () { $class * 2 }->(1)), '42', 'anonyfun';