Skip to content

Commit

Permalink
Add test for ocaml#5925
Browse files Browse the repository at this point in the history
NV_VARS6 and NV_VARS8 should be foo (no colons)
  • Loading branch information
dra27 committed Apr 28, 2024
1 parent 31a9a49 commit df5a5b3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/reftests/env.test
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ setenv: [
[ NV_VARS3 := "foo" ]
[ NV_VARS4 = "" ]
[ NV_VARS5 += "" ] # undefined in the environment
[ NV_VARS6 = "" ]
[ NV_VARS6 += "foo" ]
[ NV_VARS7 = "" ]
[ NV_VARS7 := "foo" ]
[ NV_VARS8 = "" ]
[ NV_VARS8 =+ "foo" ]
[ NV_VARS9 = "" ]
[ NV_VARS9 =: "foo" ]
]
flags: compiler
### opam switch create emptyvar nv
Expand All @@ -95,12 +103,24 @@ Done.
NV_VARS=
NV_VARS3=foo:
NV_VARS4=
NV_VARS6=foo:
NV_VARS7=foo:
NV_VARS8=:foo
NV_VARS9=:foo
### opam env | grep "NV_VARS" | ';' -> ':'
NV_VARS3='foo:': export NV_VARS3:
NV_VARS4='': export NV_VARS4:
NV_VARS6='foo:': export NV_VARS6:
NV_VARS7='foo:': export NV_VARS7:
NV_VARS8=':foo': export NV_VARS8:
NV_VARS9=':foo': export NV_VARS9:
### opam exec -- opam env --revert | grep "NV_VARS" | ';' -> ':'
NV_VARS3='': export NV_VARS3:
NV_VARS4='': export NV_VARS4:
NV_VARS6='': export NV_VARS6:
NV_VARS7='': export NV_VARS7:
NV_VARS8='': export NV_VARS8:
NV_VARS9='': export NV_VARS9:
### NV_VARS=/another/path
### NV_VARS2=/another/different/path
### NV_VARS3=/yet/another/different/path
Expand All @@ -110,12 +130,24 @@ NV_VARS=/another/path
NV_VARS2=/another/different/path
NV_VARS3=foo:/yet/another/different/path
NV_VARS4=
NV_VARS6=foo:
NV_VARS7=foo:
NV_VARS8=:foo
NV_VARS9=:foo
### opam env | grep "NV_VARS" | ';' -> ':'
NV_VARS3='foo:/yet/another/different/path': export NV_VARS3:
NV_VARS4='': export NV_VARS4:
NV_VARS6='foo:': export NV_VARS6:
NV_VARS7='foo:': export NV_VARS7:
NV_VARS8=':foo': export NV_VARS8:
NV_VARS9=':foo': export NV_VARS9:
### opam exec -- opam env --revert | grep "NV_VARS" | ';' -> ':'
NV_VARS3='/yet/another/different/path': export NV_VARS3:
NV_VARS4='': export NV_VARS4:
NV_VARS6='': export NV_VARS6:
NV_VARS7='': export NV_VARS7:
NV_VARS8='': export NV_VARS8:
NV_VARS9='': export NV_VARS9:
### : Full revert of uninstalled package with setenv :
### <pkg:foo.1>
opam-version: "2.0"
Expand Down Expand Up @@ -171,6 +203,10 @@ Done.
### opam env --root "$RT" --switch "./$SW" | grep "NV_VARS" | ';' -> ':'
NV_VARS3='foo:/yet/another/different/path': export NV_VARS3:
NV_VARS4='': export NV_VARS4:
NV_VARS6='foo:': export NV_VARS6:
NV_VARS7='foo:': export NV_VARS7:
NV_VARS8=':foo': export NV_VARS8:
NV_VARS9=':foo': export NV_VARS9:
### OPAMNOENVNOTICE=1
### : Env hooks :
### <pkg:av.1>
Expand Down

0 comments on commit df5a5b3

Please sign in to comment.