Rename REAMDE to README.md
[nit.git] / tests / string_ffi_ref_test.nit
index 70977d8..427d28c 100644 (file)
 
 module string_ffi_ref_test
 
-class StringTest
+intrude import string
+import file
 
-       var copied_str: nullable String
+class StringTest
 
-       var referenced_str: nullable String
+       var copied_str: nullable String = null
 
-       init
-       do
-               copied_str = null
-               referenced_str = null
-       end
+       var referenced_str: nullable String = null
 
-       fun get_c_string import String::items, NativeString::to_s, NativeString::to_s_with_copy, StringTest::ref_test, StringTest::copy_test `{
+       fun get_c_string import FlatString.items, NativeString.to_s, NativeString.to_s_with_copy, StringTest.ref_test, StringTest.copy_test `{
                char* string = "This is a test string";
 
-               String ref_string = NativeString_to_s(string);
+               FlatString ref_string = NativeString_to_s(string);
                StringTest_ref_test(recv, ref_string);
 
-               String copy_string = NativeString_to_s_with_copy(string);
+               FlatString copy_string = NativeString_to_s_with_copy(string);
                StringTest_copy_test(recv, copy_string);
 
-               int same_refs = String_items(copy_string) == String_items(ref_string);
+               int same_refs = FlatString_items(copy_string) == FlatString_items(ref_string);
 
                printf("Do the strings have the same NativeString reference ? ");