Skip to content

Commit 687698e

Browse files
authored
test: module clash across packages (#11246)
This PR adds a test that covers importing modules defined in multiple packages. Currently, will resolve the module to its first occurrence in the its search order. However, this will soon change, so this test is designed to analyze that behavior.
1 parent 8a0ee9a commit 687698e

File tree

12 files changed

+53
-0
lines changed

12 files changed

+53
-0
lines changed

tests/pkg/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
lake-manifest.json
2+
produced.out
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Diff
2+
3+
def testDiff := foo
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Same
2+
3+
def testSame := same

tests/pkg/mod_clash/clean.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rm -rf .lake lake-manifest.json produced.out
2+
rm -rf depA/.lake depA/lake-manifest.json
3+
rm -rf depB/.lake depB/lake-manifest.json

tests/pkg/mod_clash/depA/Diff.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def foo := "depA"

tests/pkg/mod_clash/depA/Same.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def same := 0
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name = "depA"
2+
3+
[[lean_lib]]
4+
name = "Same"
5+
6+
[[lean_lib]]
7+
name = "Diff"

tests/pkg/mod_clash/depB/Diff.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def bar := "depB"

tests/pkg/mod_clash/depB/Same.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def same := 0
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name = "depB"
2+
3+
[[lean_lib]]
4+
name = "Same"
5+
6+
[[lean_lib]]
7+
name = "Diff"

0 commit comments

Comments
 (0)