Skip to content

Commit abf9b64

Browse files
author
tpfz
committed
fix ut
1 parent 9ae0531 commit abf9b64

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

backend/modules/evaluation/pkg/utils/trim_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ func TestGenerateTextPreview(t *testing.T) {
193193
expected: "hello world",
194194
},
195195
{
196-
name: "exact 500 runes",
197-
input: string(make([]rune, 500)),
198-
expected: string(make([]rune, 500)),
196+
name: "exact 100 runes",
197+
input: string(make([]rune, 100)),
198+
expected: string(make([]rune, 100)),
199199
},
200200
{
201201
name: "long ascii content should be trimmed",
202-
input: string(make([]byte, 600)),
202+
input: string(make([]byte, 200)),
203203
},
204204
{
205205
name: "utf8 content shorter than limit should not be trimmed",
@@ -216,8 +216,8 @@ func TestGenerateTextPreview(t *testing.T) {
216216

217217
switch tt.name {
218218
case "long ascii content should be trimmed":
219-
assert.Len(t, []rune(got), 503) // 500 chars + "..."
220-
assert.Equal(t, "...", string([]rune(got)[500:]))
219+
assert.Len(t, []rune(got), 103) // 100 chars + "..."
220+
assert.Equal(t, "...", string([]rune(got)[100:]))
221221
default:
222222
assert.Equal(t, tt.expected, got)
223223
}

0 commit comments

Comments
 (0)