Skip to content

Commit fd860fc

Browse files
committed
Concat: nicer test messages
1 parent f48e5da commit fd860fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/slices/slices_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,8 @@ func TestConcat(t *testing.T) {
11131113
}
11141114

11151115
func TestConcat_too_large(t *testing.T) {
1116-
type b [0]byte
1116+
// Use zero length element to minimize memory in testing
1117+
type void struct{}
11171118
cases := []struct {
11181119
lengths []int
11191120
shouldPanic bool
@@ -1149,9 +1150,9 @@ func TestConcat_too_large(t *testing.T) {
11491150
}
11501151
for _, tc := range cases {
11511152
var r any
1152-
var ss [][]b
1153+
ss := make([][]void, 0, len(tc.lengths))
11531154
for _, l := range tc.lengths {
1154-
s := make([]b, l)
1155+
s := make([]void, l)
11551156
ss = append(ss, s)
11561157
}
11571158
func() {

0 commit comments

Comments
 (0)