From: Jean Privat Date: Fri, 28 Aug 2015 03:10:54 +0000 (-0400) Subject: tests: improve tests base_import X-Git-Tag: v0.7.8~60^2~2 X-Git-Url: http://nitlanguage.org?hp=318deb8af3fb3a647353cfe29f20980e291670b1 tests: improve tests base_import Signed-off-by: Jean Privat --- diff --git a/tests/base_import.nit b/tests/base_import.nit index 8fb3e6c..8f972aa 100644 --- a/tests/base_import.nit +++ b/tests/base_import.nit @@ -1,3 +1,23 @@ -import project1 #alt1# import project1::module1 #alt2# import project1::module2 #alt3# import project1::fail #alt4# import project1::module4 #alt5# import project1::project2 +# 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 project1 #alt1-6# +#alt1#import project1::module1 +#alt2#import project1::module2 +#alt3#import project1::fail +#alt4#import project1::module4 +#alt5#import project1::project2 +#alt6#import fail::module1 foo diff --git a/tests/base_import2.nit b/tests/base_import2.nit new file mode 100644 index 0000000..1b2955e --- /dev/null +++ b/tests/base_import2.nit @@ -0,0 +1,18 @@ +# 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 module_0 #alt1-3# +#alt1#import project1::module_0 +#alt2#import project1::module_01 +#alt3#import project1::module_02 diff --git a/tests/project1/module_0.nit b/tests/project1/module_0.nit new file mode 100644 index 0000000..5604c67 --- /dev/null +++ b/tests/project1/module_0.nit @@ -0,0 +1,18 @@ +# 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 + +1.output +0.output diff --git a/tests/project1/module_01.nit b/tests/project1/module_01.nit new file mode 100644 index 0000000..8499bb9 --- /dev/null +++ b/tests/project1/module_01.nit @@ -0,0 +1,15 @@ +# 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 module_0 diff --git a/tests/project1/module_02.nit b/tests/project1/module_02.nit new file mode 100644 index 0000000..58207a5 --- /dev/null +++ b/tests/project1/module_02.nit @@ -0,0 +1,15 @@ +# 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 ::module_0 diff --git a/tests/project1/subdir/module_0.nit b/tests/project1/subdir/module_0.nit new file mode 100644 index 0000000..9c6ed48 --- /dev/null +++ b/tests/project1/subdir/module_0.nit @@ -0,0 +1,19 @@ +# 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 + +1.output +'s'.output +0.output diff --git a/tests/sav/base_import2.res b/tests/sav/base_import2.res new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/sav/base_import2.res @@ -0,0 +1 @@ +0 diff --git a/tests/sav/base_import2_alt1.res b/tests/sav/base_import2_alt1.res new file mode 100644 index 0000000..2bac1c7 --- /dev/null +++ b/tests/sav/base_import2_alt1.res @@ -0,0 +1 @@ +alt/base_import2_alt1.nit:16,8--25: Error: conflicting module files for `module_0`: `./project1/module_0.nit,./project1/subdir/module_0.nit` diff --git a/tests/sav/base_import2_alt2.res b/tests/sav/base_import2_alt2.res new file mode 100644 index 0000000..b261da1 --- /dev/null +++ b/tests/sav/base_import2_alt2.res @@ -0,0 +1,2 @@ +1 +0 diff --git a/tests/sav/base_import2_alt3.res b/tests/sav/base_import2_alt3.res new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/sav/base_import2_alt3.res @@ -0,0 +1 @@ +0 diff --git a/tests/sav/base_import_alt3.res b/tests/sav/base_import_alt3.res index debc62f..968b927 100644 --- a/tests/sav/base_import_alt3.res +++ b/tests/sav/base_import_alt3.res @@ -1 +1 @@ -alt/base_import_alt3.nit:1,8--21: Error: cannot find module `fail` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib. +alt/base_import_alt3.nit:18,8--21: Error: cannot find module `fail` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib. diff --git a/tests/sav/base_import_alt5.res b/tests/sav/base_import_alt5.res index 7be428f..d64fbf2 100644 --- a/tests/sav/base_import_alt5.res +++ b/tests/sav/base_import_alt5.res @@ -1 +1 @@ -alt/base_import_alt5.nit:1,8--25: Error: cannot find module `project2` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib. +alt/base_import_alt5.nit:20,8--25: Error: cannot find module `project2` from `project1`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib. diff --git a/tests/sav/base_import_alt6.res b/tests/sav/base_import_alt6.res new file mode 100644 index 0000000..0cc549d --- /dev/null +++ b/tests/sav/base_import_alt6.res @@ -0,0 +1 @@ +alt/base_import_alt6.nit:21,8--20: Error: cannot find `fail`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.