From 12ba9924aa07aea266e1cfe38b243e17dcd0dc03 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sat, 18 Apr 2015 22:12:11 +0700 Subject: [PATCH] tests: add base_arg_named_inherit.nit Signed-off-by: Jean Privat --- tests/base_arg_named_inherit.nit | 34 +++++++++++++++++++++++ tests/sav/base_arg_named_inherit.res | 42 +++++++++++++++++++++++++++++ tests/sav/base_arg_named_inherit_alt1.res | 6 +++++ tests/sav/base_arg_named_inherit_alt2.res | 3 +++ 4 files changed, 85 insertions(+) create mode 100644 tests/base_arg_named_inherit.nit create mode 100644 tests/sav/base_arg_named_inherit.res create mode 100644 tests/sav/base_arg_named_inherit_alt1.res create mode 100644 tests/sav/base_arg_named_inherit_alt2.res diff --git a/tests/base_arg_named_inherit.nit b/tests/base_arg_named_inherit.nit new file mode 100644 index 0000000..22f62f0 --- /dev/null +++ b/tests/base_arg_named_inherit.nit @@ -0,0 +1,34 @@ +# 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 base_arg_default + +class B + super A + redef fun foo(x,y,z,t,u,v) do super +end + +#alt2#redef class A +#alt2# redef fun foo(x,y,z,t,u,v) do super +#alt2#end + +var a = new A #alt1# var a = new B +a.foo(a=1,b=2,3,4,e=5,f=6) +a.foo(f=6,3,e=5,b=2,4,a=1) +a.foo(3,e=5,b=2,4) + +var b = new B #alt1# var b = new A +b.foo(x=1,y=2,3,4,u=5,v=6) +b.foo(v=6,3,u=5,y=2,4,x=1) +b.foo(3,u=5,y=2,4) diff --git a/tests/sav/base_arg_named_inherit.res b/tests/sav/base_arg_named_inherit.res new file mode 100644 index 0000000..17a46de --- /dev/null +++ b/tests/sav/base_arg_named_inherit.res @@ -0,0 +1,42 @@ +1 +2 +3 +4 +5 +6 +- +1 +2 +3 +4 +5 +6 +- + +2 +3 +4 +5 + +- +1 +2 +3 +4 +5 +6 +- +1 +2 +3 +4 +5 +6 +- + +2 +3 +4 +5 + +- diff --git a/tests/sav/base_arg_named_inherit_alt1.res b/tests/sav/base_arg_named_inherit_alt1.res new file mode 100644 index 0000000..aa69f50 --- /dev/null +++ b/tests/sav/base_arg_named_inherit_alt1.res @@ -0,0 +1,6 @@ +alt/base_arg_named_inherit_alt1.nit:27,7: Error: no parameter `a` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`. +alt/base_arg_named_inherit_alt1.nit:28,7: Error: no parameter `f` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`. +alt/base_arg_named_inherit_alt1.nit:29,9: Error: no parameter `e` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`. +alt/base_arg_named_inherit_alt1.nit:32,7: Error: no parameter `x` for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`. +alt/base_arg_named_inherit_alt1.nit:33,7: Error: no parameter `v` for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`. +alt/base_arg_named_inherit_alt1.nit:34,9: Error: no parameter `u` for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`. diff --git a/tests/sav/base_arg_named_inherit_alt2.res b/tests/sav/base_arg_named_inherit_alt2.res new file mode 100644 index 0000000..2a85022 --- /dev/null +++ b/tests/sav/base_arg_named_inherit_alt2.res @@ -0,0 +1,3 @@ +alt/base_arg_named_inherit_alt2.nit:27,7: Error: no parameter `a` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`. +alt/base_arg_named_inherit_alt2.nit:28,7: Error: no parameter `f` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`. +alt/base_arg_named_inherit_alt2.nit:29,9: Error: no parameter `e` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`. -- 1.7.9.5