Skip to content

Commit dbe3ef6

Browse files
committed
chore: bump deps
1 parent cba122f commit dbe3ef6

6 files changed

Lines changed: 19 additions & 23 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: gomod
44
directory: "/"
55
schedule:
6-
interval: weekly
6+
interval: monthly
77
groups:
88
all:
99
patterns:
@@ -12,7 +12,7 @@ updates:
1212
- package-ecosystem: "github-actions"
1313
directory: "/"
1414
schedule:
15-
interval: weekly
15+
interval: monthly
1616
groups:
1717
all:
1818
patterns:

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
go-version: [ "1.24", "1.25" ]
13+
go-version: [ "1.25", "1.26" ]
1414
runs-on: ubuntu-latest
1515
env:
16-
GOLANGCI_LINT_VERSION: v2.4.0
16+
GOLANGCI_LINT_VERSION: v2.11.3
1717

1818
steps:
1919
- name: Checkout code

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/hamba/testutils
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/ryanuber/go-glob v1.0.0

retry/retry.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var DefaultPolicy = func() Policy {
2929

3030
// TestingT represents a partial *testing.T.
3131
type TestingT interface {
32-
Log(args ...interface{})
32+
Log(args ...any)
3333
FailNow()
3434
}
3535

@@ -106,35 +106,35 @@ func (t *SubT) Cleanup(fn func()) {
106106
}
107107

108108
// Log adds a log line to the current test run.
109-
func (t *SubT) Log(args ...interface{}) {
109+
func (t *SubT) Log(args ...any) {
110110
t.log(fmt.Sprintln(args...))
111111
}
112112

113113
// Logf adds a formatted log line to the current test run.
114-
func (t *SubT) Logf(format string, args ...interface{}) {
114+
func (t *SubT) Logf(format string, args ...any) {
115115
t.log(fmt.Sprintf(format, args...))
116116
}
117117

118118
// Error adds a log line and fails the current test run.
119-
func (t *SubT) Error(args ...interface{}) {
119+
func (t *SubT) Error(args ...any) {
120120
t.log(fmt.Sprintln(args...))
121121
t.Fail()
122122
}
123123

124124
// Errorf adds a formatted log line and fails the current test run.
125-
func (t *SubT) Errorf(format string, args ...interface{}) {
125+
func (t *SubT) Errorf(format string, args ...any) {
126126
t.log(fmt.Sprintf(format, args...))
127127
t.Fail()
128128
}
129129

130130
// Fatal adds a log line, fails the current test run and exits immediately.
131-
func (t *SubT) Fatal(args ...interface{}) {
131+
func (t *SubT) Fatal(args ...any) {
132132
t.log(fmt.Sprintln(args...))
133133
t.FailNow()
134134
}
135135

136136
// Fatalf adds a formatted log line, fails the current test run and exits immediately.
137-
func (t *SubT) Fatalf(format string, args ...interface{}) {
137+
func (t *SubT) Fatalf(format string, args ...any) {
138138
t.log(fmt.Sprintf(format, args...))
139139
t.FailNow()
140140
}

retry/retry_test.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const timeDeltaAllowed = float64(25 * time.Millisecond)
1515

1616
func TestRun(t *testing.T) {
1717
mockT := new(MockTestingT)
18-
mockT.On("Log", []interface{}{"test message"}).Once()
18+
mockT.On("Log", []any{"test message"}).Once()
1919
mockT.On("FailNow").Once()
2020

2121
var wg sync.WaitGroup
@@ -59,7 +59,7 @@ func TestRunWith_AllowsPassing(t *testing.T) {
5959

6060
func TestRunWith_HandlesFailing(t *testing.T) {
6161
mockT := new(MockTestingT)
62-
mockT.On("Log", []interface{}{"test message"}).Once()
62+
mockT.On("Log", []any{"test message"}).Once()
6363
mockT.On("FailNow").Once()
6464

6565
var (
@@ -100,14 +100,12 @@ func TestRunWith_RunsCleanup(t *testing.T) {
100100
var wg sync.WaitGroup
101101
var runs int
102102

103-
wg.Add(1)
104-
go func() {
105-
defer wg.Done()
103+
wg.Go(func() {
106104
retry.RunWith(mockT, retry.NewCounter(3, 10*time.Millisecond), func(t *retry.SubT) {
107105
t.Cleanup(func() { runs++ })
108106
t.FailNow()
109107
})
110-
}()
108+
})
111109
wg.Wait()
112110

113111
mockT.AssertExpectations(t)
@@ -148,7 +146,7 @@ type MockTestingT struct {
148146
mock.Mock
149147
}
150148

151-
func (m *MockTestingT) Log(args ...interface{}) {
149+
func (m *MockTestingT) Log(args ...any) {
152150
m.Called(args)
153151
}
154152

retry/rety_internal_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,10 @@ func TestT(t *testing.T) {
8383
retryT := &SubT{}
8484

8585
var wg sync.WaitGroup
86-
wg.Add(1)
87-
go func() {
88-
defer wg.Done()
86+
wg.Go(func() {
8987
test.fn(retryT)
9088
exited = false
91-
}()
89+
})
9290
wg.Wait()
9391

9492
assert.Equal(t, test.wantLog, retryT.logs)

0 commit comments

Comments
 (0)