File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
13
13
"github.com/go-git/go-git/v5"
14
14
"github.com/go-git/go-git/v5/plumbing/object"
15
+ "github.com/stretchr/testify/assert"
15
16
"github.com/stretchr/testify/require"
16
17
"github.com/utilitywarehouse/patrol/patrol"
17
18
)
@@ -72,8 +73,12 @@ func (test *RepoTest) Run(t *testing.T) {
72
73
require .NoError (t , err )
73
74
}
74
75
75
- _ , err = patrol .NewRepo (tmp )
76
+ r , err : = patrol .NewRepo (tmp )
76
77
require .NoError (t , err )
78
+
79
+ changes , err := r .ChangesFrom (test .TestAgainstRevision )
80
+ require .NoError (t , err )
81
+ assert .Equal (t , test .ExpectedChangedPackages , changes )
77
82
}
78
83
79
84
type RepoTests []RepoTest
Original file line number Diff line number Diff line change @@ -9,8 +9,11 @@ func TestRepo(t *testing.T) {
9
9
Name : "change within module" ,
10
10
Description : "A change to a package within the same module\n " +
11
11
"should flag depending packages as changed" ,
12
- TestAgainstRevision : "HEAD~1" ,
13
- ExpectedChangedPackages : []string {},
12
+ TestAgainstRevision : "HEAD~1" ,
13
+ ExpectedChangedPackages : []string {
14
+ "github.com/utilitywarehouse/internalchange/internal/bar" ,
15
+ "github.com/utilitywarehouse/internalchange/internal/foo" ,
16
+ },
14
17
},
15
18
}
16
19
You can’t perform that action at this time.
0 commit comments