File: unicode.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 (40 lines) | stat: -rw-r--r-- 770 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
28
29
30
31
32
33
34
35
36
37
38
39
40
#!perl
use utf8;
use Test::More tests => 19;

use warnings FATAL => 'all';
use strict;

use Function::Parameters qw(:lax);

fun hörps($x) { $x * 2 }
fun drau($spın̈al_tap) { $spın̈al_tap * 3 }
fun ääää($éééééé) { $éééééé * 4 }

is hörps(10), 20;
is drau(11), 33;
is ääää(12), 48;

is eval('fun á(){} 1'), 1;
is á(42), undef;

is eval('fun ́(){} 1'), undef;
like $@, qr/ parameter list/;

is eval(q<fun 'hi(){} 1>), undef;
like $@, qr/ parameter list/;

is eval('fun ::hi(){} 1'), 1;
is hi(42), undef;

is eval('fun 123(){} 1'), undef;
like $@, qr/ parameter list/;

is eval('fun main::234(){} 1'), undef;
like $@, qr/ parameter list/;

is eval('fun m123(){} 1'), 1;
is m123(42), undef;

is eval('fun ::m234(){} 1'), 1;
is m234(42), undef;