Skip to content

Commit

Permalink
test: translation of depopts field (#9432)
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Caglayan <[email protected]>
  • Loading branch information
Alizter authored Dec 9, 2023
1 parent d65ff8c commit c234f9b
Showing 1 changed file with 38 additions and 0 deletions.
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

0 comments on commit c234f9b

Please sign in to comment.