From 3cbef2c7a91554a86d1af0a9ebc20c33381e5169 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 21 Apr 2016 22:27:00 -0400 Subject: [PATCH] tests: add tests for unknown class hints Signed-off-by: Jean Privat --- tests/error_unk_class.nit | 8 +++++--- tests/error_unk_class2.nit | 16 ++++++++++++++++ tests/sav/error_unk_class.res | 5 ++++- tests/sav/error_unk_class2.res | 4 ++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 tests/error_unk_class2.nit create mode 100644 tests/sav/error_unk_class2.res diff --git a/tests/error_unk_class.nit b/tests/error_unk_class.nit index 4d9517f..76ec29d 100644 --- a/tests/error_unk_class.nit +++ b/tests/error_unk_class.nit @@ -1,7 +1,5 @@ # This file is part of NIT ( http://www.nitlanguage.org ). # -# Copyright 2004-2008 Jean Privat -# # 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 index 0000000..c452bda --- /dev/null +++ b/tests/error_unk_class2.nit @@ -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 diff --git a/tests/sav/error_unk_class.res b/tests/sav/error_unk_class.res index 7ae3800..13326c8 100644 --- a/tests/sav/error_unk_class.res +++ b/tests/sav/error_unk_class.res @@ -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 index 0000000..6b89188 --- /dev/null +++ b/tests/sav/error_unk_class2.res @@ -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`? -- 1.7.9.5