fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

test: refactor TestEncodeRanks (#454)

follow-up from a [post-merge review commment](https://github.com/sourcegraph/zoekt/pull/449#discussion_r1004473041).

+4 -10
+4 -10
read_test.go
··· 360 360 } 361 361 362 362 func TestEncodeRanks(t *testing.T) { 363 - f := func(ranks [][]float64) bool { 363 + quick.Check(func(ranks [][]float64) bool { 364 364 buf := bytes.Buffer{} 365 365 w := &writer{w: &buf} 366 366 ··· 377 377 378 378 d := &indexData{} 379 379 if err := decodeRanks(buf.Bytes(), &d.ranks); err != nil { 380 - return false 380 + t.Fatal(err) 381 381 } 382 382 383 383 if d := cmp.Diff(ranks, d.ranks, cmpopts.EquateEmpty()); d != "" { 384 - t.Logf("-want, +got:\n%s\n", d) 385 - return false 384 + t.Fatalf("-want, +got:\n%s\n", d) 386 385 } 387 386 388 387 return true 389 - } 390 - 391 - if err := quick.Check(f, nil); err != nil { 392 - t.Fatal(err) 393 - } 394 - 388 + }, nil) 395 389 }