forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(lib-collision): show dune uses the relevant loc for collision er…
…rors (ocaml#10463) Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
- Loading branch information
1 parent
371857a
commit a93443f
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
test/blackbox-tests/test-cases/lib-collision/lib-collision-public-name.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Public libraries using the same library name, in the same context, defined in | ||
the same folder. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.13) | ||
> (package (name bar) (allow_empty)) | ||
> (package (name baz) (allow_empty)) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (library | ||
> (name foo) | ||
> (public_name bar.foo)) | ||
> (library | ||
> (name foo) | ||
> (public_name baz.foo)) | ||
> EOF | ||
|
||
Without any consumers of the libraries | ||
|
||
$ dune build | ||
File "dune", line 5, characters 7-10: | ||
5 | (name foo) | ||
^^^ | ||
Error: Library "foo" appears for the second time in this directory | ||
[1] | ||
|
||
$ rm dune | ||
$ mkdir baz bar | ||
$ cat > bar/dune << EOF | ||
> (library | ||
> (name foo) | ||
> (public_name bar.foo)) | ||
> EOF | ||
$ cat > baz/dune << EOF | ||
> (library | ||
> (name foo) | ||
> (public_name baz.foo)) | ||
> EOF | ||
|
||
$ dune build | ||
|