From b91a577877b272d8aa29d1e402927490e6cc1baa Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Mon, 30 Mar 2015 19:02:55 +0700 Subject: [PATCH] tests: add base_with.nit Signed-off-by: Jean Privat --- tests/base_with.nit | 47 ++++++++++++++++++++++++ tests/sav/base_with.res | 11 ++++++ tests/sav/base_with_alt1.res | 14 +++++++ tests/sav/nitg-common/fixme/base_with_alt1.res | 13 +++++++ 4 files changed, 85 insertions(+) create mode 100644 tests/base_with.nit create mode 100644 tests/sav/base_with.res create mode 100644 tests/sav/base_with_alt1.res create mode 100644 tests/sav/nitg-common/fixme/base_with_alt1.res diff --git a/tests/base_with.nit b/tests/base_with.nit new file mode 100644 index 0000000..ad685a9 --- /dev/null +++ b/tests/base_with.nit @@ -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 index 0000000..8cada11 --- /dev/null +++ b/tests/sav/base_with.res @@ -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 index 0000000..943aa13 --- /dev/null +++ b/tests/sav/base_with_alt1.res @@ -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 index 0000000..1d2c6c1 --- /dev/null +++ b/tests/sav/nitg-common/fixme/base_with_alt1.res @@ -0,0 +1,13 @@ +1 +2 +2 +3 +1 +2 +2 +3 +1 +2 +3 +1 +2 -- 1.7.9.5