Skip to content
Snippets Groups Projects
Commit 998cf5d5 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Fix compilation error

parent a89cf583
No related branches found
No related tags found
No related merge requests found
...@@ -6,30 +6,30 @@ import ( ...@@ -6,30 +6,30 @@ import (
) )
func TestVariableString(t *testing.T) { func TestVariableString(t *testing.T) {
v := BuildVariable{"key", "value", false} v := BuildVariable{"key", "value", false, false}
assert.Equal(t, "key=value", v.String()) assert.Equal(t, "key=value", v.String())
} }
func TestPublicVariables(t *testing.T) { func TestPublicAndInternalVariables(t *testing.T) {
v1 := BuildVariable{"key", "value", false} v1 := BuildVariable{"key", "value", false, false}
v2 := BuildVariable{"public", "value", true} v2 := BuildVariable{"public", "value", true, false}
v3 := BuildVariable{"private", "value", false} v3 := BuildVariable{"private", "value", false, true}
all := BuildVariables{v1, v2, v3} all := BuildVariables{v1, v2, v3}
public := all.Public() public := all.PublicOrInternal()
assert.Contains(t, public, v2)
assert.NotContains(t, public, v1) assert.NotContains(t, public, v1)
assert.NotContains(t, public, v3) assert.Contains(t, public, v2)
assert.Contains(t, public, v3)
} }
func TestListVariables(t *testing.T) { func TestListVariables(t *testing.T) {
v := BuildVariables{{"key", "value", false}} v := BuildVariables{{"key", "value", false, false}}
assert.Equal(t, []string{"key=value"}, v.StringList()) assert.Equal(t, []string{"key=value"}, v.StringList())
} }
func TestGetVariable(t *testing.T) { func TestGetVariable(t *testing.T) {
v1 := BuildVariable{"key", "key_value", false} v1 := BuildVariable{"key", "key_value", false, false}
v2 := BuildVariable{"public", "public_value", true} v2 := BuildVariable{"public", "public_value", true, false}
v3 := BuildVariable{"private", "private_value", false} v3 := BuildVariable{"private", "private_value", false, false}
all := BuildVariables{v1, v2, v3} all := BuildVariables{v1, v2, v3}
assert.Equal(t, "public_value", all.Get("public")) assert.Equal(t, "public_value", all.Get("public"))
...@@ -39,7 +39,7 @@ func TestGetVariable(t *testing.T) { ...@@ -39,7 +39,7 @@ func TestGetVariable(t *testing.T) {
func TestParseVariable(t *testing.T) { func TestParseVariable(t *testing.T) {
v, err := ParseVariable("key=value=value2") v, err := ParseVariable("key=value=value2")
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, BuildVariable{"key", "value=value2", false}, v) assert.Equal(t, BuildVariable{"key", "value=value2", false, false}, v)
} }
func TestInvalidParseVariable(t *testing.T) { func TestInvalidParseVariable(t *testing.T) {
...@@ -49,10 +49,10 @@ func TestInvalidParseVariable(t *testing.T) { ...@@ -49,10 +49,10 @@ func TestInvalidParseVariable(t *testing.T) {
func TestVariablesExpansion(t *testing.T) { func TestVariablesExpansion(t *testing.T) {
all := BuildVariables{ all := BuildVariables{
{"key", "value_of_$public", false}, {"key", "value_of_$public", false, false},
{"public", "some_value", true}, {"public", "some_value", true, false},
{"private", "value_of_${public}", false}, {"private", "value_of_${public}", false, false},
{"public", "value_of_$undefined", true}, {"public", "value_of_$undefined", true, false},
} }
expanded := all.Expand() expanded := all.Expand()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment