Envsubst params (#1147)

* Can give envsubst optional arguments
This commit is contained in:
Mike Farah
2022-03-20 10:56:50 +11:00
committed by GitHub
parent 1a964c5055
commit 78e9cc7998
7 changed files with 238 additions and 15 deletions
+20
View File
@@ -15,6 +15,26 @@ var pathTests = []struct {
expectedTokens []interface{}
expectedPostFix []interface{}
}{
{
`envsubst(ne)`,
append(make([]interface{}, 0), "ENVSUBST_NO_EMPTY"),
append(make([]interface{}, 0), "ENVSUBST_NO_EMPTY"),
},
{
`envsubst(nu)`,
append(make([]interface{}, 0), "ENVSUBST_NO_UNSET"),
append(make([]interface{}, 0), "ENVSUBST_NO_UNSET"),
},
{
`envsubst(nu, ne)`,
append(make([]interface{}, 0), "ENVSUBST_NO_EMPTY_NO_UNSET"),
append(make([]interface{}, 0), "ENVSUBST_NO_EMPTY_NO_UNSET"),
},
{
`envsubst(ne, nu)`,
append(make([]interface{}, 0), "ENVSUBST_NO_EMPTY_NO_UNSET"),
append(make([]interface{}, 0), "ENVSUBST_NO_EMPTY_NO_UNSET"),
},
{
`[.a, .b]`,
append(make([]interface{}, 0), "[", "a", "UNION", "b", "]"),