Skip to content

Commit

Permalink
Add regression test for ocaml#4861
Browse files Browse the repository at this point in the history
As in this commit, there should be no output captured from the
opam env --revert invocation.
  • Loading branch information
dra27 committed May 15, 2024
1 parent f16bbc1 commit 7e7388c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ users)
* env tests: use `sort` to increase stability of the `opam env` output [#5935 @dra27 @rjbou]
* env.win32: add mixed slashes test [#5935 @dra27]
* env.win32: add test for environment revert not working correctly for Unix-like variables on Windows [#5935 @dra27]
* env.win32: add regression test for reverting additions to PATH-like variables [#5935 @dra27]

### Engine
* Add `sort` command [#5935 @dra27]
Expand Down
26 changes: 26 additions & 0 deletions tests/reftests/env.win32.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
N0REP0
### : setenv & build env rewriting :
### opam switch create rewriting --empty
### : Test for #4861
### <pkg:multipath.1>
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.
### : The 'set "P' -> 'set P' rewrite masks differences between whether Path
### : already contains a directory which needs escaping (e.g. building with
### : MSVC)
### opam env --shell=cmd | grep "PATH" | 'XXX:.*' -> '' | 'set "P' -> 'set P'
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:\' | 'set "P' -> 'set P'
### : Test for #5838
### opam env | grep MANPATH
MANPATH=':"${BASEDIR}/OPAM/rewriting/man"'; export MANPATH;
Expand Down Expand Up @@ -603,6 +628,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 ]
Expand Down

0 comments on commit 7e7388c

Please sign in to comment.