tests: add error_prop_name*
authorJean Privat <jean@pryen.org>
Fri, 11 Apr 2014 13:07:50 +0000 (09:07 -0400)
committerJean Privat <jean@pryen.org>
Fri, 11 Apr 2014 13:07:50 +0000 (09:07 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/error_prop_name.nit [new file with mode: 0644]
tests/error_prop_name_m1.nit [new file with mode: 0644]
tests/error_prop_name_m2.nit [new file with mode: 0644]
tests/sav/error_prop_name.res [new file with mode: 0644]
tests/sav/error_prop_name_alt1.res [new file with mode: 0644]
tests/sav/error_prop_name_alt2.res [new file with mode: 0644]
tests/sav/error_prop_name_alt3.res [new file with mode: 0644]
tests/sav/error_prop_name_alt4.res [new file with mode: 0644]
tests/sav/error_prop_name_m1.res [new file with mode: 0644]
tests/sav/error_prop_name_m2.res [new file with mode: 0644]

diff --git a/tests/error_prop_name.nit b/tests/error_prop_name.nit
new file mode 100644 (file)
index 0000000..0af0a77
--- /dev/null
@@ -0,0 +1,37 @@
+# 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 error_prop_name_m1
+import error_prop_name_m2
+
+class C
+       fun bar do 4.output
+       fun bar_c do bar
+end
+
+redef class A
+       super B
+       super C
+
+       #alt3#redef fun foo do 5.output
+       #alt4#redef fun bar do 6.output
+end
+
+var a = new A
+a.foo_a
+a.foo_b
+#alt1#a.foo
+a.bar_a
+a.bar_c
+#alt2#a.bar
diff --git a/tests/error_prop_name_m1.nit b/tests/error_prop_name_m1.nit
new file mode 100644 (file)
index 0000000..d1f1fa0
--- /dev/null
@@ -0,0 +1,23 @@
+# 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 foo do 1.output
+       fun foo_a do foo
+
+       fun bar do 2.output
+       fun bar_a do bar
+end
diff --git a/tests/error_prop_name_m2.nit b/tests/error_prop_name_m2.nit
new file mode 100644 (file)
index 0000000..a29202c
--- /dev/null
@@ -0,0 +1,20 @@
+# 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 B
+       fun foo do 3.output
+       fun foo_b do foo
+end
diff --git a/tests/sav/error_prop_name.res b/tests/sav/error_prop_name.res
new file mode 100644 (file)
index 0000000..6a1a6aa
--- /dev/null
@@ -0,0 +1,4 @@
+1
+3
+2
+4
diff --git a/tests/sav/error_prop_name_alt1.res b/tests/sav/error_prop_name_alt1.res
new file mode 100644 (file)
index 0000000..f7f0ccf
--- /dev/null
@@ -0,0 +1 @@
+alt/error_prop_name_alt1.nit:34,1--5: Ambigous property name 'foo' for A; conflict between error_prop_name_m1::A::foo and error_prop_name_m2::B::foo
diff --git a/tests/sav/error_prop_name_alt2.res b/tests/sav/error_prop_name_alt2.res
new file mode 100644 (file)
index 0000000..80410f3
--- /dev/null
@@ -0,0 +1 @@
+alt/error_prop_name_alt2.nit:37,1--5: Ambigous property name 'bar' for A; conflict between error_prop_name_m1::A::bar and error_prop_name_alt2::C::bar
diff --git a/tests/sav/error_prop_name_alt3.res b/tests/sav/error_prop_name_alt3.res
new file mode 100644 (file)
index 0000000..b21c3cb
--- /dev/null
@@ -0,0 +1 @@
+alt/error_prop_name_alt3.nit:27,12--14: Ambigous property name 'foo' for A; conflict between error_prop_name_m1::A::foo and error_prop_name_m2::B::foo
diff --git a/tests/sav/error_prop_name_alt4.res b/tests/sav/error_prop_name_alt4.res
new file mode 100644 (file)
index 0000000..1f9c04f
--- /dev/null
@@ -0,0 +1 @@
+alt/error_prop_name_alt4.nit:28,12--14: Ambigous property name 'bar' for A; conflict between error_prop_name_m1::A::bar and error_prop_name_alt4::C::bar
diff --git a/tests/sav/error_prop_name_m1.res b/tests/sav/error_prop_name_m1.res
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/sav/error_prop_name_m2.res b/tests/sav/error_prop_name_m2.res
new file mode 100644 (file)
index 0000000..e69de29