-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: translation of depopts field (#9432)
Signed-off-by: Ali Caglayan <[email protected]>
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
test/blackbox-tests/test-cases/pkg/depopts/opam-package-with-depopts.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,38 @@ | ||
We test how opam files with depopts fields are translated into dune.lock files: | ||
|
||
$ . ../helpers.sh | ||
$ mkrepo | ||
|
||
Make a package with a depopts field | ||
$ mkpkg with-depopts <<'EOF' | ||
> depopts: [ "foo" ] | ||
> EOF | ||
$ mkpkg foo | ||
|
||
$ solve with-depopts | ||
Solution for dune.lock: | ||
- with-depopts.0.0.1 | ||
|
||
When depopts are supported and selected, the above lock should change and we | ||
should also be able to see a deps field in the lock file: | ||
|
||
$ cat dune.lock/with-depopts.pkg | ||
(version 0.0.1) | ||
|
||
We should also be able to validate the lock directory: | ||
|
||
$ dune pkg validate-lockdir | ||
|
||
Depopts should not be selected if they conflict with other constraints: | ||
|
||
$ mkpkg no-foo <<'EOF' | ||
> depends: [ "with-depopts" ] | ||
> conflicts: [ "foo" ] | ||
> EOF | ||
|
||
$ solve no-foo | ||
Solution for dune.lock: | ||
- no-foo.0.0.1 | ||
- with-depopts.0.0.1 | ||
|
||
$ dune pkg validate-lockdir |