File: 04-argument-truncation.t

package info (click to toggle)
nqp 2022.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,436 kB
  • sloc: java: 28,030; perl: 3,394; ansic: 451; makefile: 200; javascript: 68; sh: 1
file content (35 lines) | stat: -rw-r--r-- 679 bytes parent folder | download | duplicates (4)
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
plan(8);

sub pos8(int8  $i) {
    ok($i==42, 'int8 pos argument works')
}
sub pos16(int16  $i) {
    ok($i==42, 'int16 pos argument works')
}
sub pos32(int32  $i) {
    ok($i==42, 'int32 pos argument works')
}
sub pos64(int64  $i) {
    ok($i==42, 'int64 pos argument works')
}
pos8(42);
pos16(42);
pos32(42);
pos64(42);

sub named8(int8  :$i) {
    ok($i==42, 'int8 named argument works')
}
sub named16(int16  :$i) {
    ok($i==42, 'int16 named argument works')
}
sub named32(int32  :$i) {
    ok($i==42, 'int32 named argument works')
}
sub named64(int64  :$i) {
    ok($i==42, 'int64 named argument works')
}
named8(:i(42));
named16(:i(42));
named32(:i(42));
named64(:i(42));