tests: add tests for unknown class hints
authorJean Privat <jean@pryen.org>
Fri, 22 Apr 2016 02:27:00 +0000 (22:27 -0400)
committerJean Privat <jean@pryen.org>
Fri, 22 Apr 2016 23:17:48 +0000 (19:17 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/error_unk_class.nit
tests/error_unk_class2.nit [new file with mode: 0644]
tests/sav/error_unk_class.res
tests/sav/error_unk_class2.res [new file with mode: 0644]

index 4d9517f..76ec29d 100644 (file)
@@ -1,7 +1,5 @@
 # This file is part of NIT ( http://www.nitlanguage.org ).
 #
-# Copyright 2004-2008 Jean Privat <jean@pryen.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
@@ -14,5 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-var i = new Canard
+var i
+i = new Fail
+i = new Boolean
+i = new ListNode
+i = new POSet
 i.output
diff --git a/tests/error_unk_class2.nit b/tests/error_unk_class2.nit
new file mode 100644 (file)
index 0000000..c452bda
--- /dev/null
@@ -0,0 +1,16 @@
+# 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 poset
+import error_unk_class
index 7ae3800..13326c8 100644 (file)
@@ -1 +1,4 @@
-error_unk_class.nit:17,13--18: Error: class `Canard` not found in module `error_unk_class`.
+error_unk_class.nit:16,9--12: Error: class `Fail` not found in module `error_unk_class`.
+error_unk_class.nit:17,9--15: Error: class `Boolean` not found in module `error_unk_class`. Did you mean `Bool`?
+error_unk_class.nit:18,9--16: Error: class `core::list::ListNode` not visible in module `error_unk_class`.
+error_unk_class.nit:19,9--13: Error: class `POSet` not found in module `error_unk_class`. Did you mean `Set`?
diff --git a/tests/sav/error_unk_class2.res b/tests/sav/error_unk_class2.res
new file mode 100644 (file)
index 0000000..6b89188
--- /dev/null
@@ -0,0 +1,4 @@
+error_unk_class.nit:16,9--12: Error: class `Fail` not found in module `error_unk_class`.
+error_unk_class.nit:17,9--15: Error: class `Boolean` not found in module `error_unk_class`. Did you mean `Bool`?
+error_unk_class.nit:18,9--16: Error: class `core::list::ListNode` not visible in module `error_unk_class`.
+error_unk_class.nit:19,9--13: Error: class `POSet` not found in module `error_unk_class`. Maybe import `poset`?