tests: add base_with_return.res
authorJean Privat <jean@pryen.org>
Fri, 8 Apr 2016 19:17:46 +0000 (15:17 -0400)
committerJean Privat <jean@pryen.org>
Fri, 8 Apr 2016 19:17:46 +0000 (15:17 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/base_with_return.nit [new file with mode: 0644]
tests/sav/base_with_return.res [new file with mode: 0644]
tests/sav/nitc-common/fixme/base_with_return.res [new file with mode: 0644]

diff --git a/tests/base_with_return.nit b/tests/base_with_return.nit
new file mode 100644 (file)
index 0000000..2fc6f9d
--- /dev/null
@@ -0,0 +1,38 @@
+# 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.
+
+import core::kernel
+
+class A
+       var a = 5
+       fun start do
+               var a = new A
+               1.output
+       end
+       fun finish do
+               var a = new A
+               3.output
+       end
+end
+
+fun foo
+do
+       with new A do
+               2.output
+               return
+       end
+end
+
+foo
+4.output
diff --git a/tests/sav/base_with_return.res b/tests/sav/base_with_return.res
new file mode 100644 (file)
index 0000000..94ebaf9
--- /dev/null
@@ -0,0 +1,4 @@
+1
+2
+3
+4
diff --git a/tests/sav/nitc-common/fixme/base_with_return.res b/tests/sav/nitc-common/fixme/base_with_return.res
new file mode 100644 (file)
index 0000000..e8a01cd
--- /dev/null
@@ -0,0 +1,3 @@
+1
+2
+4