Commit | Line | Data |
31534187 |
1 | #!perl |
2 | use utf8; |
3 | use Test::More tests => 19; |
4 | |
5 | use warnings FATAL => 'all'; |
6 | use strict; |
7 | |
8 | use Function::Parameters; |
9 | |
10 | fun hörps($x) { $x * 2 } |
11 | fun drau($spın̈al_tap) { $spın̈al_tap * 3 } |
12 | fun ääää($éééééé) { $éééééé * 4 } |
13 | |
14 | is hörps(10), 20; |
15 | is drau(11), 33; |
16 | is ääää(12), 48; |
17 | |
18 | is eval('fun á(){} 1'), 1; |
19 | is á(42), undef; |
20 | |
21 | is eval('fun ́(){} 1'), undef; |
22 | like $@, qr/ function body/; |
23 | |
24 | is eval(q<fun 'hi(){} 1>), undef; |
25 | like $@, qr/ function body/; |
26 | |
27 | is eval('fun ::hi(){} 1'), 1; |
28 | is hi(42), undef; |
29 | |
30 | is eval('fun 123(){} 1'), undef; |
31 | like $@, qr/ function body/; |
32 | |
33 | is eval('fun main::234(){} 1'), undef; |
34 | like $@, qr/ function body/; |
35 | |
36 | is eval('fun m123(){} 1'), 1; |
37 | is m123(42), undef; |
38 | |
39 | is eval('fun ::m234(){} 1'), 1; |
40 | is m234(42), undef; |