-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
formatter: support require only and suite only packages (#188)
* formatter: support require only and suite only packages * self-review fixes
- Loading branch information
Showing
6 changed files
with
122 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
analyzer/testdata/src/formatter-issue170-suite/suie_only_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package formatterissue170 | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
func TestFormatter(t *testing.T) { | ||
suite.Run(t, new(FormatterSuite)) | ||
} | ||
|
||
type FormatterSuite struct { | ||
suite.Suite | ||
} | ||
|
||
func (s *FormatterSuite) TestFormatter() { | ||
s.True(false, fmt.Sprintf("expected %v, got %v", true, false)) // want "formatter: remove unnecessary fmt\\.Sprintf" | ||
} | ||
|
||
func (s FormatterSuite) TestFormatterValueRecv() { | ||
s.False(true, fmt.Sprintf("expected %v, got %v", true, false)) // want "formatter: remove unnecessary fmt\\.Sprintf" | ||
} |
24 changes: 24 additions & 0 deletions
24
analyzer/testdata/src/formatter-issue170-suite/suie_only_test.go.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package formatterissue170 | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
func TestFormatter(t *testing.T) { | ||
suite.Run(t, new(FormatterSuite)) | ||
} | ||
|
||
type FormatterSuite struct { | ||
suite.Suite | ||
} | ||
|
||
func (s *FormatterSuite) TestFormatter() { | ||
s.True(false, "expected %v, got %v", true, false) // want "formatter: remove unnecessary fmt\\.Sprintf" | ||
} | ||
|
||
func (s FormatterSuite) TestFormatterValueRecv() { | ||
s.False(true, "expected %v, got %v", true, false) // want "formatter: remove unnecessary fmt\\.Sprintf" | ||
} |
12 changes: 12 additions & 0 deletions
12
analyzer/testdata/src/formatter-issue170/require_only_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package formatterissue170 | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestFormatter(t *testing.T) { | ||
require.True(t, false, fmt.Sprintf("expected %v, got %v", true, false)) // want "formatter: remove unnecessary fmt\\.Sprintf" | ||
} |
12 changes: 12 additions & 0 deletions
12
analyzer/testdata/src/formatter-issue170/require_only_test.go.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package formatterissue170 | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestFormatter(t *testing.T) { | ||
require.True(t, false, "expected %v, got %v", true, false) // want "formatter: remove unnecessary fmt\\.Sprintf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters