@@ -22,7 +22,6 @@ package golicenser
2222
2323import (
2424 "path/filepath"
25- "reflect"
2625 "testing"
2726 "time"
2827
@@ -47,7 +46,6 @@ func TestAnalyzer(t *testing.T) {
4746 Author : "Test" ,
4847 YearMode : YearModeThisYear ,
4948 },
50- Exclude : []string {},
5149 }
5250 a , err := NewAnalyzer (cfg )
5351 if err != nil {
@@ -97,7 +95,6 @@ func TestAnalyzer(t *testing.T) {
9795 Matcher : "Copyright \\ (c\\ ) {{.year}} Joshua" ,
9896 YearMode : YearModeThisYear ,
9997 },
100- Exclude : []string {},
10198 }
10299 a , err := NewAnalyzer (cfg )
103100 if err != nil {
@@ -169,9 +166,6 @@ func TestNewAnalyzer(t *testing.T) {
169166 t .Errorf ("CopyrightHeaderMatcher = %v, want %v" ,
170167 a .cfg .CopyrightHeaderMatcher , DefaultCopyrightHeaderMatcher )
171168 }
172- if ! reflect .DeepEqual (a .cfg .Exclude , DefaultExcludes ) {
173- t .Errorf ("Exclude = %v, want %v" , a .cfg .Exclude , DefaultExcludes )
174- }
175169 },
176170 },
177171 {
@@ -188,27 +182,23 @@ func TestNewAnalyzer(t *testing.T) {
188182 Header : header ,
189183 Exclude : []string {
190184 "/abc/*" ,
191- "**/testdata/**" ,
192185 "" , // empty strings should be ignored
193186 "/test/**" ,
194187 },
195188 },
196189 check : func (t * testing.T , a * analyzer ) {
197190 t .Helper ()
198191
199- if l := len (a .excludes ); l != 3 {
200- t .Errorf ("excludes len = %d, want 3 " , l )
192+ if l := len (a .excludes ); l != 2 {
193+ t .Errorf ("excludes len = %d, want 2 " , l )
201194 }
202195 tests := map [string ]bool {
203- "afile.go" : false ,
204- "/subdir/test" : false ,
205- "/abc/" : true ,
206- "/abc/test" : true ,
207- "/testdata/" : true ,
208- "/testdata/abc" : true ,
209- "/subdir/testdata/test" : true ,
210- "/test/somefile" : true ,
211- "/test/" : true ,
196+ "afile.go" : false ,
197+ "/subdir/test" : false ,
198+ "/abc/" : true ,
199+ "/abc/test" : true ,
200+ "/test/somefile" : true ,
201+ "/test/" : true ,
212202 }
213203 for path , want := range tests {
214204 var excluded bool
@@ -279,7 +269,7 @@ func TestNewAnalyzer(t *testing.T) {
279269 Header : header ,
280270 Exclude : []string {
281271 "/abc/*" ,
282- "**/testdata /*{*" ,
272+ "**/test /*{*" ,
283273 },
284274 },
285275 wantErr : true ,
0 commit comments