From 06c71e755150a22453d76ee321666ee82051dcfe Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 25 Apr 2024 13:55:56 +0100 Subject: [PATCH] Add regression test for #4861 As in this commit, there should be no output captured from the opam env --revert invocation. --- tests/reftests/env.win32.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/reftests/env.win32.test b/tests/reftests/env.win32.test index 6fc91462028..346b33c77e7 100644 --- a/tests/reftests/env.win32.test +++ b/tests/reftests/env.win32.test @@ -1,6 +1,28 @@ N0REP0 ### : setenv & build env rewriting : ### opam switch create rewriting --empty +### : Test for #4861 +### +opam-version: "2.0" +setenv: [ + [ PATH += "XXX:\\" ] + [ PATH += "C:\\Devel\\bin1;C:\\Devel\\bin2;\"C:\\Devel\\bin3;\";ZZZ:\\;C:\\Devel\\bin4" ] +] +x-env-path-rewrite: [ + [ PATH false ] +] +### opam install multipath -yv | sed-cmd sh | unordered +The following actions will be performed: +=== install 1 package +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed multipath.1 +Done. + - install multipath 1 + +### opam env --shell=cmd | grep "PATH" | 'XXX:.*' -> '' +set "MANPATH=:"${BASEDIR}/OPAM/rewriting/man"" +set "PATH=${BASEDIR}/OPAM/rewriting/bin;C:\Devel\bin1;C:\Devel\bin2;"C:\Devel\bin3;";ZZZ:\;C:\Devel\bin4; +### opam exec -- opam env --shell=cmd --revert | grep 'ZZZ:' ### : Test for #5838 ### opam env | grep MANPATH MANPATH=':"${BASEDIR}/OPAM/rewriting/man"'; export MANPATH; @@ -595,6 +617,7 @@ x-env-path-rewrite: [ [ RF_ENVSET_WITH_COL false ] [ RF_ENVSET_ADD false ] [ RF_ENVSET_ADD_WITH_COL false ] + [ PATH false ] [ RF_ENVBUILD false ] [ RF_ENVBUILD_STR false ]