tests: test -m with nit.nit
authorJean Privat <jean@pryen.org>
Wed, 4 Sep 2013 09:31:13 +0000 (05:31 -0400)
committerJean Privat <jean@pryen.org>
Wed, 4 Sep 2013 17:15:10 +0000 (13:15 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/nit.args
tests/niti.skip
tests/sav/nit_args3.res [new file with mode: 0644]
tests/sav/test_mixin.res [new file with mode: 0644]
tests/test_mixin.nit [new file with mode: 0644]

index b028002..3011fc1 100644 (file)
@@ -1,2 +1,3 @@
 --log --log-dir out/test_nitc_logs ../examples/hello_world.nit
 base_simple3.nit
+-m test_mixin.nit ../examples/hello_world.nit
index 832179d..e107b9e 100644 (file)
@@ -6,6 +6,7 @@ test_mem
 shoot_logic
 bench_
 nit_args1
+nit_args3
 nitc_args1
 nitg_args1
 nitg_args3
diff --git a/tests/sav/nit_args3.res b/tests/sav/nit_args3.res
new file mode 100644 (file)
index 0000000..c76ebf3
--- /dev/null
@@ -0,0 +1,3 @@
+MIX: Before
+MIX: hello world
+MIX: After
diff --git a/tests/sav/test_mixin.res b/tests/sav/test_mixin.res
new file mode 100644 (file)
index 0000000..8ca502a
--- /dev/null
@@ -0,0 +1,2 @@
+MIX: Before
+MIX: After
diff --git a/tests/test_mixin.nit b/tests/test_mixin.nit
new file mode 100644 (file)
index 0000000..d89fab6
--- /dev/null
@@ -0,0 +1,22 @@
+# 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.
+
+redef fun print(s)
+do
+       super("MIX: {s}")
+end
+
+print "Before"
+super
+print "After"