Skip to content

Commit

Permalink
test: filtering depends/depopts with {version} (#11021)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg authored Oct 18, 2024
1 parent af95981 commit 82537f6
Showing 1 changed file with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Demonstrate how dependencies are filtered in opam files:

$ . ../helpers.sh

$ build_single_package() {
> solve_project <<EOF
> (lang dune 3.11)
> (package
> (name x)
> (depends
> $1))
> EOF
> build_pkg $1
> }

$ mkrepo

$ mkpkg "foo"

Regular dependencies

$ mkpkg "testpkg" 1 <<'EOF'
> depends: [ "foo" {version = 1} ]
> EOF

$ solve testpkg
Solution for dune.lock:
- foo.0.0.1
- testpkg.1

$ mkpkg "testpkg" 2 <<'EOF'
> depends: [ "foo" {version = 1} ]
> EOF

$ solve testpkg
Solution for dune.lock:
- testpkg.2

Depopts. We don't have proper support for depopts yet, so these don't work.
When depopts are enabled though, the test should demonstrate that depopts works
the same way as depends

$ mkpkg "testpkg" 1 <<'EOF'
> depopts: [ "foo" {version = 1} ]
> EOF

$ solve testpkg
Solution for dune.lock:
- testpkg.2

$ mkpkg "testpkg" 2 <<'EOF'
> depopts: [ "foo" {version = 1} ]
> EOF

$ solve testpkg
Solution for dune.lock:
- testpkg.2

0 comments on commit 82537f6

Please sign in to comment.