Skip to content

Commit 4aec5e8

Browse files
committed
ci: improve test case
1 parent c7709a5 commit 4aec5e8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

dataloader_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,20 @@ func testLoadMany(t *testing.T) {
279279
t.Errorf("Unexpected results: %v", results)
280280
}
281281

282-
results = loader.LoadMany(context.Background(), []int{1, 2, 3, 4, 5, 6, 7, 8})
282+
results = loader.LoadMany(context.Background(), []int{1, 2, 3, 4, 5, 6, 7, 8, 1})
283283
if results[0].err != nil || results[1].err != nil || results[2].err != nil {
284284
t.Errorf("Unexpected error: %v", results)
285285
}
286-
if len(results) != 8 {
286+
if len(results) != 9 {
287287
t.Errorf("Expected 3 results, got %d", len(results))
288288
}
289289
if results[0].data != "Result for 1" || results[1].data != "Result for 2" || results[2].data != "Result for 3" {
290290
t.Errorf("Unexpected results: %v", results)
291291
}
292+
293+
if results[8].data != "Result for 1" {
294+
t.Errorf("Unexpected results: %v", results)
295+
}
292296
}
293297

294298
func testLoadMap(t *testing.T) {
@@ -315,7 +319,7 @@ func testLoadMap(t *testing.T) {
315319
t.Errorf("Expected 3 results, got %d", len(results))
316320
}
317321

318-
results = loader.LoadMap(context.Background(), []int{1, 2, 3, 4, 5, 6, 7, 8})
322+
results = loader.LoadMap(context.Background(), []int{1, 2, 3, 4, 5, 6, 7, 8, 1})
319323
for k, v := range results {
320324
data, err := v.Unwrap()
321325
if err != nil {
@@ -327,7 +331,7 @@ func testLoadMap(t *testing.T) {
327331
}
328332

329333
if len(results) != 8 {
330-
t.Errorf("Expected 3 results, got %d", len(results))
334+
t.Errorf("Expected 8 results, got %d", len(results))
331335
}
332336
}
333337

0 commit comments

Comments
 (0)