Skip to content

Commit

Permalink
Add test with multiple restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonidas-from-XIV committed Feb 15, 2022
1 parent da4c711 commit 4a9621c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/bin/invalid-package-version.t/multiple-constraint.opam
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
opam-version: "2.0"
depends: [
"dune"
"a" {>= "1.1" & < "2.0"}
"depends-on-min-a"
"a" {< "2.0"}
]
x-opam-monorepo-opam-repositories: [
"file://$OPAM_MONOREPO_CWD/minimal-repo"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
opam-version: "2.0"
dev-repo: "git+https://a.com/depends-on-min-a.git"
depends: [
"dune"
"a" {>= "1.0"}
]
url {
src: "https://a.com/depends-on-min-a.0.1.tbz"
checksum: [
"sha256=0000000000000000000000000000000000000000000000000000000000000000"
]
}
4 changes: 2 additions & 2 deletions test/bin/invalid-package-version.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ to the test)
We should also produce the right error message with all the constraints when we have multiple constaints
$ opam show --no-lint --raw -fdepends ./multiple-constraint.opam
"dune" "a" {>= "1.1" & < "2.0"}
"dune" "depends-on-min-a" "a" {< "2.0"}
$ opam-monorepo lock multiple-constraint 2> errors
==> Using 1 locally scanned package as the target.
[1]
$ grep -Pazo "(?s)opam-monorepo: \[ERROR\].*(?=opam-monorepo)" < errors | head --bytes=-1
opam-monorepo: [ERROR] There is no eligible version of a that matches >= 1.1 & < 2.0
opam-monorepo: [ERROR] There is no eligible version of a that matches >= 1.0

0 comments on commit 4a9621c

Please sign in to comment.