tests: add base_with.nit
authorJean Privat <jean@pryen.org>
Mon, 30 Mar 2015 12:02:55 +0000 (19:02 +0700)
committerJean Privat <jean@pryen.org>
Fri, 3 Apr 2015 07:59:19 +0000 (14:59 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/base_with.nit [new file with mode: 0644]
tests/sav/base_with.res [new file with mode: 0644]
tests/sav/base_with_alt1.res [new file with mode: 0644]
tests/sav/nitg-common/fixme/base_with_alt1.res [new file with mode: 0644]

diff --git a/tests/base_with.nit b/tests/base_with.nit
new file mode 100644 (file)
index 0000000..ad685a9
--- /dev/null
@@ -0,0 +1,47 @@
+# 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 kernel
+
+class A
+       fun start do 1.output
+       fun work do 2.output
+       fun finish do 3.output
+end
+
+fun escape do
+       with a = new A do
+               a.work
+               if true then return
+               a.work
+       end
+end
+
+with new A do
+       2.output
+       2.output
+end
+
+with a = new A do
+       a.work
+       a.work
+end
+
+with a = new A do
+       a.work
+       if true then break
+       a.work
+end
+
+#alt1#escape
diff --git a/tests/sav/base_with.res b/tests/sav/base_with.res
new file mode 100644 (file)
index 0000000..8cada11
--- /dev/null
@@ -0,0 +1,11 @@
+1
+2
+2
+3
+1
+2
+2
+3
+1
+2
+3
diff --git a/tests/sav/base_with_alt1.res b/tests/sav/base_with_alt1.res
new file mode 100644 (file)
index 0000000..943aa13
--- /dev/null
@@ -0,0 +1,14 @@
+1
+2
+2
+3
+1
+2
+2
+3
+1
+2
+3
+1
+2
+3
diff --git a/tests/sav/nitg-common/fixme/base_with_alt1.res b/tests/sav/nitg-common/fixme/base_with_alt1.res
new file mode 100644 (file)
index 0000000..1d2c6c1
--- /dev/null
@@ -0,0 +1,13 @@
+1
+2
+2
+3
+1
+2
+2
+3
+1
+2
+3
+1
+2