Skip to content

Commit

Permalink
Add test for ocaml#5926
Browse files Browse the repository at this point in the history
NV_VARS10 should be a:b and NV_VARS11 should be b:a (no leading colon)
  • Loading branch information
dra27 committed Apr 28, 2024
1 parent df5a5b3 commit 2f303bd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/reftests/env.test
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ setenv: [
[ NV_VARS8 =+ "foo" ]
[ NV_VARS9 = "" ]
[ NV_VARS9 =: "foo" ]
[ NV_VARS10 := "a" ]
[ NV_VARS10 =: "b" ]
[ NV_VARS11 =: "a" ]
[ NV_VARS11 := "b" ]
[ NV_VARS12 := "a" ]
[ NV_VARS13 =: "b" ]
]
flags: compiler
### opam switch create emptyvar nv
Expand All @@ -101,6 +107,10 @@ Switch invariant: ["nv"]
Done.
### opam exec -- env | grep "NV_VARS" | ';' -> ':'
NV_VARS=
NV_VARS10=:a:b
NV_VARS11=:b:a
NV_VARS12=a:
NV_VARS13=:b
NV_VARS3=foo:
NV_VARS4=
NV_VARS6=foo:
Expand All @@ -114,19 +124,31 @@ NV_VARS6='foo:': export NV_VARS6:
NV_VARS7='foo:': export NV_VARS7:
NV_VARS8=':foo': export NV_VARS8:
NV_VARS9=':foo': export NV_VARS9:
NV_VARS10=':a:b': export NV_VARS10:
NV_VARS11=':b:a': export NV_VARS11:
NV_VARS12='a:': export NV_VARS12:
NV_VARS13=':b': export NV_VARS13:
### 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_VARS10='': export NV_VARS10:
NV_VARS11='': export NV_VARS11:
NV_VARS12='': export NV_VARS12:
NV_VARS13='': export NV_VARS13:
### NV_VARS=/another/path
### NV_VARS2=/another/different/path
### NV_VARS3=/yet/another/different/path
### NV_VARS4=ignored-value
### opam exec -- env | grep "NV_VARS" | ';' -> ':'
NV_VARS=/another/path
NV_VARS10=:a:b
NV_VARS11=:b:a
NV_VARS12=a:
NV_VARS13=:b
NV_VARS2=/another/different/path
NV_VARS3=foo:/yet/another/different/path
NV_VARS4=
Expand All @@ -141,13 +163,21 @@ NV_VARS6='foo:': export NV_VARS6:
NV_VARS7='foo:': export NV_VARS7:
NV_VARS8=':foo': export NV_VARS8:
NV_VARS9=':foo': export NV_VARS9:
NV_VARS10=':a:b': export NV_VARS10:
NV_VARS11=':b:a': export NV_VARS11:
NV_VARS12='a:': export NV_VARS12:
NV_VARS13=':b': export NV_VARS13:
### 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:
NV_VARS10='': export NV_VARS10:
NV_VARS11='': export NV_VARS11:
NV_VARS12='': export NV_VARS12:
NV_VARS13='': export NV_VARS13:
### : Full revert of uninstalled package with setenv :
### <pkg:foo.1>
opam-version: "2.0"
Expand Down Expand Up @@ -207,6 +237,10 @@ NV_VARS6='foo:': export NV_VARS6:
NV_VARS7='foo:': export NV_VARS7:
NV_VARS8=':foo': export NV_VARS8:
NV_VARS9=':foo': export NV_VARS9:
NV_VARS10=':a:b': export NV_VARS10:
NV_VARS11=':b:a': export NV_VARS11:
NV_VARS12='a:': export NV_VARS12:
NV_VARS13=':b': export NV_VARS13:
### OPAMNOENVNOTICE=1
### : Env hooks :
### <pkg:av.1>
Expand Down

0 comments on commit 2f303bd

Please sign in to comment.