misc/vim: inform the user when no results are found
[nit.git] / tests / test_ffi_c_callback_extern_receiver.nit
index 25d456f..3fe526c 100644 (file)
 # tests for a recurring bug when callbacking a Nit method on an extern receiver 
 module test_ffi_c_callback_extern_receiver
 
-extern Test
+`{
+#include <stdio.h>
+`}
+
+extern class Test
     new create_me is extern `{
         int* foobar = malloc(sizeof(int));
         *foobar = 12345;
         return foobar;
     `}
-    fun test_me is extern import Test::foo `{
+
+    fun test_me is extern import Test.foo, NativeString.to_s `{
         int i;
         for(i = 0; i < 2000; ++i) {
             printf("%d\n", i);
-            Test_foo(recv, new_String_from_cstring("asdf"));
+            Test_foo(recv, NativeString_to_s("asdf"));
         }
     `}
+
     fun foo(bar : String) do
         print bar
     end
 end
+
 var t = new Test.create_me
 t.test_me