Skip to content

Commit 30f4265

Browse files
build(deps): bump github.com/ldez/usetesting from 0.3.0 to 0.4.0 (#5264)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent 11d508e commit 30f4265

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ require (
6868
github.com/ldez/gomoddirectives v0.6.0
6969
github.com/ldez/grignotin v0.7.0
7070
github.com/ldez/tagliatelle v0.7.1
71-
github.com/ldez/usetesting v0.3.0
71+
github.com/ldez/usetesting v0.4.0
7272
github.com/leonklingele/grouper v1.1.2
7373
github.com/macabu/inamedparam v0.1.3
7474
github.com/maratori/testableexamples v1.0.0

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//golangcitest:args -Eusetesting
2+
//golangcitest:expected_exitcode 0
3+
package testdata
4+
5+
import (
6+
"os"
7+
"testing"
8+
)
9+
10+
func Test_osCreateTemp(t *testing.T) {
11+
os.CreateTemp("", "") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
12+
os.CreateTemp("", "xx") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
13+
os.CreateTemp(os.TempDir(), "xx")
14+
os.CreateTemp(t.TempDir(), "xx")
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//golangcitest:args -Eusetesting
2+
//golangcitest:expected_exitcode 0
3+
package testdata
4+
5+
import (
6+
"os"
7+
"testing"
8+
)
9+
10+
func Test_osCreateTemp(t *testing.T) {
11+
os.CreateTemp(t.TempDir(), "") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
12+
os.CreateTemp(t.TempDir(), "xx") // want `os\.CreateTemp\("", \.\.\.\) could be replaced by os\.CreateTemp\(t\.TempDir\(\), \.\.\.\) in .+`
13+
os.CreateTemp(os.TempDir(), "xx")
14+
os.CreateTemp(t.TempDir(), "xx")
15+
}

pkg/golinters/usetesting/usetesting_integration_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ import (
99
func TestFromTestdata(t *testing.T) {
1010
integration.RunTestdata(t)
1111
}
12+
13+
func TestFix(t *testing.T) {
14+
integration.RunFix(t)
15+
}
16+
17+
func TestFixPathPrefix(t *testing.T) {
18+
integration.RunFixPathPrefix(t)
19+
}

0 commit comments

Comments
 (0)