Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for wrapper sub with native parameter types.

Closes issue #12 in conjunction with NQP commit a886a77
  • Loading branch information...
commit d47cd3f855335753fa932b8be7017b32b7a86a52 1 parent bc26b5e
@arnsholt arnsholt authored
Showing with 11 additions and 1 deletion.
  1. +4 −0 t/02-simple-args.c
  2. +7 −1 t/02-simple-args.t
View
4 t/02-simple-args.c
@@ -74,3 +74,7 @@ DLLEXPORT void SetString(char *str) {
DLLEXPORT void PrintString() {
printf("%s\n", cached_str);
}
+
+DLLEXPORT void wrapped(int n) {
+ printf("ok - wrapped sub\n");
+}
View
8 t/02-simple-args.t
@@ -2,7 +2,7 @@ use lib '.';
use t::CompileTestLib;
use NativeCall;
-say "1..10";
+say "1..11";
compile_test_lib('02-simple-args');
@@ -32,4 +32,10 @@ explicitly-manage($str);
SetString($str);
PrintString();
+# Make sure wrapped subs work
+sub wrapped(int) is native('./02-simple-args') { * }
+sub wrapper(int $arg) { wrapped($arg) }
+
+wrapper(1);
+
# vim:ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.