diff --git a/test/blackbox-tests/test-cases/pkg/opam-package-cycle-with-or.t b/test/blackbox-tests/test-cases/pkg/opam-package-cycle-with-or.t new file mode 100644 index 00000000000..74716f4f57f --- /dev/null +++ b/test/blackbox-tests/test-cases/pkg/opam-package-cycle-with-or.t @@ -0,0 +1,30 @@ +We test an repository with a package cycle that has an alternative solution which avoids a +cycle. We have the following packages: + +> a --> b --> c + +Now c depends either on a or on a fourth package d. Therefore there is a valid solution +available that avoids a cycle. + + $ . ./helpers.sh + $ mkrepo + + $ mkpkg a < depends: [ "b" ] + > EOF + $ mkpkg b < depends: [ "c" ] + > EOF + $ mkpkg c < depends: [ "a" | "d" ] + > EOF + $ mkpkg d + +Solver finds the invalid solution as it doesn't check cycles. + + $ solve c + Solution for dune.lock: + a.0.0.1 + b.0.0.1 + c.0.0.1 + diff --git a/test/blackbox-tests/test-cases/pkg/opam-package-cycle.t b/test/blackbox-tests/test-cases/pkg/opam-package-cycle.t new file mode 100644 index 00000000000..0340815d0e0 --- /dev/null +++ b/test/blackbox-tests/test-cases/pkg/opam-package-cycle.t @@ -0,0 +1,35 @@ +Testing how the solver handles cycles in an opam repository. + + $ . ./helpers.sh + $ mkrepo + + $ mkpkg a <<'EOF' + > depends: [ "b" ] + > EOF + $ mkpkg b <<'EOF' + > depends: [ "c" ] + > EOF + $ mkpkg c <<'EOF' + > depends: [ "a" ] + > EOF + +Solver doesn't complain about cycles. + + $ solve a + Solution for dune.lock: + a.0.0.1 + b.0.0.1 + c.0.0.1 + + $ solve b + Solution for dune.lock: + a.0.0.1 + b.0.0.1 + c.0.0.1 + + $ solve c + Solution for dune.lock: + a.0.0.1 + b.0.0.1 + c.0.0.1 +