tests: improve tests base_import
authorJean Privat <jean@pryen.org>
Fri, 28 Aug 2015 03:10:54 +0000 (23:10 -0400)
committerJean Privat <jean@pryen.org>
Fri, 28 Aug 2015 03:17:20 +0000 (23:17 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

13 files changed:
tests/base_import.nit
tests/base_import2.nit [new file with mode: 0644]
tests/project1/module_0.nit [new file with mode: 0644]
tests/project1/module_01.nit [new file with mode: 0644]
tests/project1/module_02.nit [new file with mode: 0644]
tests/project1/subdir/module_0.nit [new file with mode: 0644]
tests/sav/base_import2.res [new file with mode: 0644]
tests/sav/base_import2_alt1.res [new file with mode: 0644]
tests/sav/base_import2_alt2.res [new file with mode: 0644]
tests/sav/base_import2_alt3.res [new file with mode: 0644]
tests/sav/base_import_alt3.res
tests/sav/base_import_alt5.res
tests/sav/base_import_alt6.res [new file with mode: 0644]

index 8fb3e6c..8f972aa 100644 (file)
@@ -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 (file)
index 0000000..1b2955e
--- /dev/null
@@ -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 (file)
index 0000000..5604c67
--- /dev/null
@@ -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 (file)
index 0000000..8499bb9
--- /dev/null
@@ -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 (file)
index 0000000..58207a5
--- /dev/null
@@ -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 (file)
index 0000000..9c6ed48
--- /dev/null
@@ -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 (file)
index 0000000..573541a
--- /dev/null
@@ -0,0 +1 @@
+0
diff --git a/tests/sav/base_import2_alt1.res b/tests/sav/base_import2_alt1.res
new file mode 100644 (file)
index 0000000..2bac1c7
--- /dev/null
@@ -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 (file)
index 0000000..b261da1
--- /dev/null
@@ -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 (file)
index 0000000..573541a
--- /dev/null
@@ -0,0 +1 @@
+0
index debc62f..968b927 100644 (file)
@@ -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.
index 7be428f..d64fbf2 100644 (file)
@@ -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 (file)
index 0000000..0cc549d
--- /dev/null
@@ -0,0 +1 @@
+alt/base_import_alt6.nit:21,8--20: Error: cannot find `fail`. Tried: ., ../lib/standard, ../lib/standard/collection, alt, ../lib, ../contrib.