@@ -63,7 +63,7 @@ func TestAnalyzer(t *testing.T) { //nolint:funlen
6363 }{
6464 {"basic" , args {level : level .Basic , regex : testre , pkg : "test/basic" }, "test/basic.myError (value methods)" },
6565 {"full" , args {level : level .Full , excludes : set .New (excludedTypeNames ... ), pkg : "test/a" }, "[0]string" },
66- {"exclusions" , args {level : level .Full , pkg : "test/e" }, "" },
66+ {"exclusions" , args {level : level .Full , pkg : "test/e" }, "test/e.NotExcluded " },
6767 }
6868 for _ , tt := range tests {
6969 t .Run (tt .name , func (t * testing.T ) {
@@ -79,7 +79,6 @@ func TestAnalyzer(t *testing.T) { //nolint:funlen
7979 if tt .args .regex != nil && tt .args .regex .String () != "" {
8080 v .Check .Regex = tt .args .regex
8181 }
82-
8382 a := & analysis.Analyzer {
8483 Name : "zerolint" ,
8584 Doc : "..." ,
@@ -90,16 +89,9 @@ func TestAnalyzer(t *testing.T) { //nolint:funlen
9089
9190 res := analysistest .RunWithSuggestedFixes (t , dir , a , tt .args .pkg )
9291
93- if tt .want != "" {
94- d := res [0 ].Result .(result.Detected ) //nolint:forcetypeassert
95- if d .Empty () {
96- t .Error ("Expected detection of zero-sized types" )
97- }
98-
99- zerotypes := d .Sorted ()
100- if ! slices .Contains (zerotypes , tt .want ) {
101- t .Errorf ("Expected %q to contain %q" , zerotypes , tt .want )
102- }
92+ d := res [0 ].Result .(result.Detected ) //nolint:forcetypeassert
93+ if zerotypes := d .Sorted (); ! slices .Contains (zerotypes , tt .want ) {
94+ t .Errorf ("Expected %q to contain %q" , zerotypes , tt .want )
10395 }
10496 })
10597 }
0 commit comments