@@ -2,12 +2,12 @@ package slogt
2
2
3
3
import (
4
4
"fmt"
5
+ "log/slog"
5
6
"strings"
6
7
"testing"
7
8
8
9
"github.com/stretchr/testify/assert"
9
10
"github.com/stretchr/testify/require"
10
- "log/slog"
11
11
)
12
12
13
13
func Test_TestHandler (t * testing.T ) {
@@ -19,7 +19,7 @@ func Test_TestHandler(t *testing.T) {
19
19
assert .Len (t , tm .rows , 1 , "should be 1 row" )
20
20
assert .Contains (t , tm .rows [0 ], "t=" )
21
21
assert .Contains (t , tm .rows [0 ], fmt .Sprintf (" l=%s" , slog .LevelDebug .String ()))
22
- assert .Contains (t , tm .rows [0 ], " s=testing_test .go:17" )
22
+ assert .Contains (t , tm .rows [0 ], " s=thandler_test .go:17" )
23
23
assert .Contains (t , tm .rows [0 ], fmt .Sprintf (" %s=test" , slog .MessageKey ))
24
24
assert .Contains (t , tm .rows [0 ], " key=value" )
25
25
@@ -36,7 +36,7 @@ func Test_TestHandler(t *testing.T) {
36
36
assert .Equal (t , "some\n multiline\n message" , strings .Join (tm .rows [:3 ], "\n " ))
37
37
assert .Contains (t , tm .rows [3 ], "t=" )
38
38
assert .Contains (t , tm .rows [3 ], fmt .Sprintf (" l=%s" , slog .LevelDebug .String ()))
39
- assert .Contains (t , tm .rows [3 ], " s=testing_test .go:34" )
39
+ assert .Contains (t , tm .rows [3 ], " s=thandler_test .go:34" )
40
40
assert .Contains (t , tm .rows [3 ], `msg="message with newlines has been printed to t.Log"` )
41
41
})
42
42
}
0 commit comments