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