@@ -22,7 +22,6 @@ import (
22
22
// of an importer converting from an external config format to dep's.
23
23
type TestCase struct {
24
24
DefaultConstraintFromLock bool
25
- WantConvertErr bool
26
25
WantSourceRepo string
27
26
WantConstraint string
28
27
WantRevision gps.Revision
@@ -45,7 +44,7 @@ func NewTestContext(h *test.Helper) *dep.Ctx {
45
44
}
46
45
47
46
// Execute and validate the test case.
48
- func (tc TestCase ) Execute (t * testing.T , convert func (logger * log.Logger , sm gps.SourceManager ) (* dep.Manifest , * dep.Lock , error )) error {
47
+ func (tc TestCase ) Execute (t * testing.T , convert func (logger * log.Logger , sm gps.SourceManager ) (* dep.Manifest , * dep.Lock )) error {
49
48
h := test .NewHelper (t )
50
49
defer h .Cleanup ()
51
50
// Disable parallel tests until we can resolve this error on the Windows builds:
@@ -61,23 +60,12 @@ func (tc TestCase) Execute(t *testing.T, convert func(logger *log.Logger, sm gps
61
60
output := & bytes.Buffer {}
62
61
ctx .Err = log .New (output , "" , 0 )
63
62
64
- manifest , lock , convertErr := convert (ctx .Err , sm )
65
- return tc .validate (manifest , lock , convertErr , output )
63
+ manifest , lock := convert (ctx .Err , sm )
64
+ return tc .validate (manifest , lock , output )
66
65
}
67
66
68
67
// validate returns an error if any of the testcase validations failed.
69
- func (tc TestCase ) validate (manifest * dep.Manifest , lock * dep.Lock , convertErr error , output * bytes.Buffer ) error {
70
- if tc .WantConvertErr {
71
- if convertErr == nil {
72
- return errors .New ("Expected the conversion to fail, but it did not return an error" )
73
- }
74
- return nil
75
- }
76
-
77
- if convertErr != nil {
78
- return errors .Wrap (convertErr , "Expected the conversion to pass, but it returned an error" )
79
- }
80
-
68
+ func (tc TestCase ) validate (manifest * dep.Manifest , lock * dep.Lock , output * bytes.Buffer ) error {
81
69
if ! equalSlice (manifest .Ignored , tc .WantIgnored ) {
82
70
return errors .Errorf ("unexpected set of ignored projects: \n \t (GOT) %#v \n \t (WNT) %#v" ,
83
71
manifest .Ignored , tc .WantIgnored )
0 commit comments