loader: use join_path to search the lib directory
[nit.git] / tests / test_new_native.nit
index d2c35fc..c1ecc49 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-redef class NativeArray[E]
-       new(length: Int) is intern
-end
-
-redef class NativeString
-       new(length: Int) is intern
-end
-
 var s = new NativeString(4)
 s[0] = 'N'
 s[2] = 't'
@@ -39,3 +31,10 @@ print a.length
 print a[0]
 print a.to_a.join(",")
 
+var i
+i = 3
+a = new NativeArray[Int](i)
+i = 1
+a[i] = i
+print a[i]
+print a[1]