From 09284a15e7637f4969ab3b954a681e1047841be2 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 14 Mar 2023 10:16:53 +0000 Subject: [PATCH] Test revert when setenv package uninstalled --- tests/reftests/env.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/reftests/env.test b/tests/reftests/env.test index 85c2910363b..eb13540639a 100644 --- a/tests/reftests/env.test +++ b/tests/reftests/env.test @@ -124,3 +124,20 @@ Switch invariant: ["nv"] -> installed nv.1 Done. # Run eval $(opam env '--root=${BASEDIR}/root 2' '--switch=${BASEDIR}/switch w spaces') to update the current shell environment +### opam switch create full-revert --empty +# Run eval $(opam env --switch=full-revert) to update the current shell environment +### opam install nv +The following actions will be performed: +=== install 1 package + - install nv 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed nv.1 +Done. +# Run eval $(opam env) to update the current shell environment +### opam exec -- opam env --revert | grep "NV_VARS" | ';' -> ':' +NV_VARS3='/yet/another/different/path': export NV_VARS3: +NV_VARS4='': export NV_VARS4: +### opam exec -- sh -c "opam remove nv ; opam env --revert" | grep "NV_VARS" | ';' -> ':' +NV_VARS3='/yet/another/different/path': export NV_VARS3: +NV_VARS4='': export NV_VARS4: