From 2f25a4c6fcac5036908859e61e0f0d975bb7f64d 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 df018e4a9ce..6a14b27b015 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;C:\\Devel\\bin4;ZZZ:\\" ] +] +x-env-path-rewrite: [ + [ PATH false ] +] +### opam install multipath -yv +The following actions will be performed: +=== install 1 package + - install multipath 1 + +<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> +-> installed multipath.1 +Done. +### 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;C:\Devel\bin4;ZZZ:\; +### opam exec -- opam env --shell=cmd --revert | grep 'ZZZ:' | 'ZZZ:\\.*' -> 'ZZZ:\' ### : Test for #5838 ### opam env | grep MANPATH MANPATH=':"${BASEDIR}/OPAM/rewriting/man"'; export MANPATH; @@ -603,6 +625,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 ]