@@ -172,57 +172,6 @@ func TestResolveBuiltinVariables(t *testing.T) {
172172 }
173173}
174174
175- func TestResolveBuiltinVariablesInPackageInternal (t * testing.T ) {
176- tests := []struct {
177- Name string
178- Prep [][]string
179- Env []string
180- ExpectedPrep [][]string
181- ExpectedEnv []string
182- }{
183- {
184- Name : "prep with __pkg_version" ,
185- Prep : [][]string {{"/bin/bash" , "prepare.sh" , "${__pkg_version}" }},
186- ExpectedPrep : [][]string {{"/bin/bash" , "prepare.sh" , "this-version" }},
187- },
188- {
189- Name : "env with __pkg_version" ,
190- Env : []string {"VERSION=${__pkg_version}" },
191- ExpectedEnv : []string {"VERSION=this-version" },
192- },
193- {
194- Name : "prep and env with __pkg_version" ,
195- Prep : [][]string {{"echo" , "${__pkg_version}" }},
196- Env : []string {"BUILD_VERSION=${__pkg_version}" },
197- ExpectedPrep : [][]string {{"echo" , "this-version" }},
198- ExpectedEnv : []string {"BUILD_VERSION=this-version" },
199- },
200- }
201-
202- for _ , test := range tests {
203- t .Run (test .Name , func (t * testing.T ) {
204- pkg := NewTestPackage ("pkg" )
205- pkg .Type = GenericPackage
206- pkg .Config = GenericPkgConfig {Commands : [][]string {{"echo" , "hello" }}}
207- pkg .PreparationCommands = test .Prep
208- pkg .Environment = test .Env
209-
210- err := pkg .resolveBuiltinVariables ()
211- if err != nil {
212- t .Fatalf ("unexpected error: %v" , err )
213- }
214-
215- if test .ExpectedPrep != nil && ! reflect .DeepEqual (pkg .PreparationCommands , test .ExpectedPrep ) {
216- t .Errorf ("PreparationCommands mismatch. expected: %v, actual: %v" , test .ExpectedPrep , pkg .PreparationCommands )
217- }
218-
219- if test .ExpectedEnv != nil && ! reflect .DeepEqual (pkg .Environment , test .ExpectedEnv ) {
220- t .Errorf ("Environment mismatch. expected: %v, actual: %v" , test .ExpectedEnv , pkg .Environment )
221- }
222- })
223- }
224- }
225-
226175func TestFindCycles (t * testing.T ) {
227176 tests := []struct {
228177 Name string
0 commit comments