Skip to content

Commit

Permalink
build(deps): bump github.com/ldez/usetesting from 0.3.0 to 0.4.0 (#5264)
Browse files Browse the repository at this point in the history
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and ldez authored Dec 28, 2024
1 parent 11d508e commit 30f4265
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ require (
github.com/ldez/gomoddirectives v0.6.0
github.com/ldez/grignotin v0.7.0
github.com/ldez/tagliatelle v0.7.1
github.com/ldez/usetesting v0.3.0
github.com/ldez/usetesting v0.4.0
github.com/leonklingele/grouper v1.1.2
github.com/macabu/inamedparam v0.1.3
github.com/maratori/testableexamples v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pkg/golinters/usetesting/testdata/fix/in/usetesting.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//golangcitest:args -Eusetesting
//golangcitest:expected_exitcode 0
package testdata

import (
"os"
"testing"
)

func Test_osCreateTemp(t *testing.T) {
os.CreateTemp("", "") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
os.CreateTemp("", "xx") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
os.CreateTemp(os.TempDir(), "xx")
os.CreateTemp(t.TempDir(), "xx")
}
15 changes: 15 additions & 0 deletions pkg/golinters/usetesting/testdata/fix/out/usetesting.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//golangcitest:args -Eusetesting
//golangcitest:expected_exitcode 0
package testdata

import (
"os"
"testing"
)

func Test_osCreateTemp(t *testing.T) {
os.CreateTemp(t.TempDir(), "") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
os.CreateTemp(t.TempDir(), "xx") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
os.CreateTemp(os.TempDir(), "xx")
os.CreateTemp(t.TempDir(), "xx")
}
8 changes: 8 additions & 0 deletions pkg/golinters/usetesting/usetesting_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ import (
func TestFromTestdata(t *testing.T) {
integration.RunTestdata(t)
}

func TestFix(t *testing.T) {
integration.RunFix(t)
}

func TestFixPathPrefix(t *testing.T) {
integration.RunFixPathPrefix(t)
}

0 comments on commit 30f4265

Please # to comment.