tests: Basic test for the allocation of NativeArray with short native values
authorLucas Bajolet <r4pass@hotmail.com>
Thu, 28 May 2015 21:10:31 +0000 (17:10 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Thu, 28 May 2015 21:11:20 +0000 (17:11 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

tests/base_native_array.nit [new file with mode: 0644]
tests/sav/base_native_array.res [new file with mode: 0644]

diff --git a/tests/base_native_array.nit b/tests/base_native_array.nit
new file mode 100644 (file)
index 0000000..e59c93e
--- /dev/null
@@ -0,0 +1,24 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+intrude import standard::collection::array
+
+var a = new Array[Bool]
+var cpt = 0
+while cpt < 20 do
+       a.push(false)
+       cpt += 1
+end
+
+for i in a do i.output
diff --git a/tests/sav/base_native_array.res b/tests/sav/base_native_array.res
new file mode 100644 (file)
index 0000000..9486349
--- /dev/null
@@ -0,0 +1,20 @@
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false
+false