@@ -22,7 +22,6 @@ package golicenser
22
22
23
23
import (
24
24
"path/filepath"
25
- "reflect"
26
25
"testing"
27
26
"time"
28
27
@@ -47,7 +46,6 @@ func TestAnalyzer(t *testing.T) {
47
46
Author : "Test" ,
48
47
YearMode : YearModeThisYear ,
49
48
},
50
- Exclude : []string {},
51
49
}
52
50
a , err := NewAnalyzer (cfg )
53
51
if err != nil {
@@ -97,7 +95,6 @@ func TestAnalyzer(t *testing.T) {
97
95
Matcher : "Copyright \\ (c\\ ) {{.year}} Joshua" ,
98
96
YearMode : YearModeThisYear ,
99
97
},
100
- Exclude : []string {},
101
98
}
102
99
a , err := NewAnalyzer (cfg )
103
100
if err != nil {
@@ -169,9 +166,6 @@ func TestNewAnalyzer(t *testing.T) {
169
166
t .Errorf ("CopyrightHeaderMatcher = %v, want %v" ,
170
167
a .cfg .CopyrightHeaderMatcher , DefaultCopyrightHeaderMatcher )
171
168
}
172
- if ! reflect .DeepEqual (a .cfg .Exclude , DefaultExcludes ) {
173
- t .Errorf ("Exclude = %v, want %v" , a .cfg .Exclude , DefaultExcludes )
174
- }
175
169
},
176
170
},
177
171
{
@@ -188,27 +182,23 @@ func TestNewAnalyzer(t *testing.T) {
188
182
Header : header ,
189
183
Exclude : []string {
190
184
"/abc/*" ,
191
- "**/testdata/**" ,
192
185
"" , // empty strings should be ignored
193
186
"/test/**" ,
194
187
},
195
188
},
196
189
check : func (t * testing.T , a * analyzer ) {
197
190
t .Helper ()
198
191
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 )
201
194
}
202
195
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 ,
212
202
}
213
203
for path , want := range tests {
214
204
var excluded bool
@@ -279,7 +269,7 @@ func TestNewAnalyzer(t *testing.T) {
279
269
Header : header ,
280
270
Exclude : []string {
281
271
"/abc/*" ,
282
- "**/testdata /*{*" ,
272
+ "**/test /*{*" ,
283
273
},
284
274
},
285
275
wantErr : true ,
0 commit comments