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 authored and rjbou committed Jan 20, 2022
1 parent 35899ba commit c1e6243
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/reftests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,23 @@
%{targets}
(run ./run.exe %{bin:opam} %{dep:pin.test} %{read-lines:testing-env}))))

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

(alias
(name reftest)
(deps (alias reftest-remove)))

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

(rule
(alias reftest-show)
(action
Expand Down
48 changes: 48 additions & 0 deletions tests/reftests/remove.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.

0 comments on commit c1e6243

Please sign in to comment.