Skip to content

Commit

Permalink
Add some tests for package remove
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Jan 18, 2022
1 parent 6579c09 commit 7e9105b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tests/reftests/basic.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
N0REP0
### :::::: removal of partial dependencies (#4727)
### <pkg:a.1>
opam-version: "2.0"
### <pkg:b.1>
opam-version: "2.0"
### <pkg:c.1>
opam-version: "2.0"
depends: "a" | "b"
### opam switch create default --empty
### opam install a b c
The following actions will be performed:
- install b 1
- install a 1
- install c 1
===== 3 to install =====

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed a.1
-> installed b.1
-> installed c.1
Done.
### opam remove a --show
The following actions would be performed:
- remove a 1
- recompile c 1 [uses a]
===== 1 to recompile | 1 to remove =====
### opam remove --auto --show
Nothing to do.
### opam remove a --auto --show
The following actions would be performed:
- remove c 1 [uses a]
- remove a 1
===== 2 to remove =====
### :::::: message on removal of an unavailable package (#4890)
### <pkg:z.1>
opam-version: "2.0"
available: false
### <pkg:w.1>
opam-version: "2.0"
depends: "z"
### opam remove z
[ERROR] z: unmet availability conditions: 'false'
# Return code 5 #
### opam remove w
[NOTE] w is not installed.

Nothing to do.
17 changes: 17 additions & 0 deletions tests/reftests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@
%{targets}
(run ./run.exe %{bin:opam} %{dep:avoid-version.test} %{read-lines:testing-env}))))

(rule
(alias reftest-basic)
(action
(diff basic.test basic.out)))

(alias
(name reftest)
(deps (alias reftest-basic)))

(rule
(targets basic.out)
(deps root-N0REP0)
(action
(with-stdout-to
%{targets}
(run ./run.exe %{bin:opam} %{dep:basic.test} %{read-lines:testing-env}))))

(rule
(alias reftest-cli-versioning)
(action
Expand Down

0 comments on commit 7e9105b

Please sign in to comment.