Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (32 sloc) 1.065 kB
2a2c373 @moritz include path fixes
moritz authored
1 use lib '.';
bee23d5 @jnthn Test file 2 will just be for args; add tests for float, double and st…
authored
2 use t::CompileTestLib;
3 use NativeCall;
4
d47cd3f @arnsholt Add test for wrapper sub with native parameter types.
arnsholt authored
5 say "1..11";
bee23d5 @jnthn Test file 2 will just be for args; add tests for float, double and st…
authored
6
7 compile_test_lib('02-simple-args');
8
9 # Int related
2152160 @tadzik Fix tests on linux
tadzik authored
10 sub TakeInt(int32) is native('./02-simple-args') { * }
11 sub TakeTwoShorts(int16, int16) is native('./02-simple-args') { * }
12 sub AssortedIntArgs(int32, int16, int8) is native('./02-simple-args') { * }
bee23d5 @jnthn Test file 2 will just be for args; add tests for float, double and st…
authored
13 TakeInt(42);
14 TakeTwoShorts(10, 20);
15 AssortedIntArgs(101, 102, 103);
16
17 # Float related
2152160 @tadzik Fix tests on linux
tadzik authored
18 sub TakeADouble(num64) is native('./02-simple-args') { * }
19 sub TakeAFloat(num32) is native('./02-simple-args') { * }
bee23d5 @jnthn Test file 2 will just be for args; add tests for float, double and st…
authored
20 TakeADouble(-6.9e0);
21 TakeAFloat(4.2e0);
22
23 # String related
2152160 @tadzik Fix tests on linux
tadzik authored
24 sub TakeAString(Str) is native('./02-simple-args') { * }
bee23d5 @jnthn Test file 2 will just be for args; add tests for float, double and st…
authored
25 TakeAString('ok 9 - passed a string');
e94f45c @arnsholt Tests and support functions for explicitly managing strings.
arnsholt authored
26
27 # Explicitly managing strings
28 sub SetString(Str) is native('./02-simple-args') { * }
29 sub PrintString() is native('./02-simple-args') { * }
30 my $str = 'ok 10 - delayed string print';
31 explicitly-manage($str);
32 SetString($str);
33 PrintString();
34
d47cd3f @arnsholt Add test for wrapper sub with native parameter types.
arnsholt authored
35 # Make sure wrapped subs work
36 sub wrapped(int) is native('./02-simple-args') { * }
37 sub wrapper(int $arg) { wrapped($arg) }
38
39 wrapper(1);
40
e94f45c @arnsholt Tests and support functions for explicitly managing strings.
arnsholt authored
41 # vim:ft=perl6
Something went wrong with that request. Please try again.