@@ -14,7 +14,7 @@ import (
14
14
)
15
15
16
16
func TestAutogeneratedExclude_isGeneratedFileLax_generated (t * testing.T ) {
17
- p := NewAutogeneratedExclude (false )
17
+ p := NewAutogeneratedExclude (AutogeneratedModeLax )
18
18
19
19
comments := []string {
20
20
` // generated by stringer -type Pill pill.go; DO NOT EDIT` ,
@@ -56,7 +56,7 @@ func TestAutogeneratedExclude_isGeneratedFileLax_generated(t *testing.T) {
56
56
}
57
57
58
58
func TestAutogeneratedExclude_isGeneratedFileLax_nonGenerated (t * testing.T ) {
59
- p := NewAutogeneratedExclude (false )
59
+ p := NewAutogeneratedExclude (AutogeneratedModeLax )
60
60
61
61
comments := []string {
62
62
"code not generated by" ,
@@ -75,7 +75,7 @@ func TestAutogeneratedExclude_isGeneratedFileLax_nonGenerated(t *testing.T) {
75
75
}
76
76
77
77
func TestAutogeneratedExclude_isGeneratedFileStrict (t * testing.T ) {
78
- p := NewAutogeneratedExclude (true )
78
+ p := NewAutogeneratedExclude (AutogeneratedModeStrict )
79
79
80
80
testCases := []struct {
81
81
desc string
@@ -154,21 +154,21 @@ func Test_getComments_fileWithLongLine(t *testing.T) {
154
154
func Test_shouldPassIssue (t * testing.T ) {
155
155
testCases := []struct {
156
156
desc string
157
- strict bool
157
+ mode string
158
158
issue * result.Issue
159
159
assert assert.BoolAssertionFunc
160
160
}{
161
161
{
162
- desc : "typecheck issue" ,
163
- strict : false ,
162
+ desc : "typecheck issue" ,
163
+ mode : AutogeneratedModeLax ,
164
164
issue : & result.Issue {
165
165
FromLinter : "typecheck" ,
166
166
},
167
167
assert : assert .True ,
168
168
},
169
169
{
170
- desc : "lax " ,
171
- strict : false ,
170
+ desc : "lax " ,
171
+ mode : AutogeneratedModeLax ,
172
172
issue : & result.Issue {
173
173
FromLinter : "example" ,
174
174
Pos : token.Position {
@@ -178,8 +178,8 @@ func Test_shouldPassIssue(t *testing.T) {
178
178
assert : assert .False ,
179
179
},
180
180
{
181
- desc : "strict " ,
182
- strict : true ,
181
+ desc : "strict " ,
182
+ mode : AutogeneratedModeStrict ,
183
183
issue : & result.Issue {
184
184
FromLinter : "example" ,
185
185
Pos : token.Position {
@@ -195,7 +195,7 @@ func Test_shouldPassIssue(t *testing.T) {
195
195
t .Run (test .desc , func (t * testing.T ) {
196
196
t .Parallel ()
197
197
198
- p := NewAutogeneratedExclude (test .strict )
198
+ p := NewAutogeneratedExclude (test .mode )
199
199
200
200
pass , err := p .shouldPassIssue (test .issue )
201
201
require .NoError (t , err )
@@ -213,13 +213,13 @@ func Test_shouldPassIssue_error(t *testing.T) {
213
213
214
214
testCases := []struct {
215
215
desc string
216
- strict bool
216
+ mode string
217
217
issue * result.Issue
218
218
expected string
219
219
}{
220
220
{
221
- desc : "non-existing file (lax)" ,
222
- strict : false ,
221
+ desc : "non-existing file (lax)" ,
222
+ mode : AutogeneratedModeLax ,
223
223
issue : & result.Issue {
224
224
FromLinter : "example" ,
225
225
Pos : token.Position {
@@ -230,8 +230,8 @@ func Test_shouldPassIssue_error(t *testing.T) {
230
230
filepath .FromSlash ("no-existing.go" ), notFoundMsg ),
231
231
},
232
232
{
233
- desc : "non-existing file (strict)" ,
234
- strict : true ,
233
+ desc : "non-existing file (strict)" ,
234
+ mode : AutogeneratedModeStrict ,
235
235
issue : & result.Issue {
236
236
FromLinter : "example" ,
237
237
Pos : token.Position {
@@ -248,7 +248,7 @@ func Test_shouldPassIssue_error(t *testing.T) {
248
248
t .Run (test .desc , func (t * testing.T ) {
249
249
t .Parallel ()
250
250
251
- p := NewAutogeneratedExclude (test .strict )
251
+ p := NewAutogeneratedExclude (test .mode )
252
252
253
253
pass , err := p .shouldPassIssue (test .issue )
254
254
0 commit comments