backend: Fix test compilation with Go 1.18 and 1.19

This commit is contained in:
Michael Eischer 2023-05-18 20:38:43 +02:00
parent 18eb1d3ab0
commit 609367195a

View file

@ -222,6 +222,10 @@ func (s *Suite[C]) TestLoad(t *testing.T) {
test.OK(t, b.Remove(context.TODO(), handle))
}
type setter interface {
SetListMaxItems(int)
}
// TestList makes sure that the backend implements List() pagination correctly.
func (s *Suite[C]) TestList(t *testing.T) {
seedRand(t)
@ -269,10 +273,6 @@ func (s *Suite[C]) TestList(t *testing.T) {
t.Run(fmt.Sprintf("max-%v", test.maxItems), func(t *testing.T) {
list2 := make(map[restic.ID]int64)
type setter interface {
SetListMaxItems(int)
}
if s, ok := b.(setter); ok {
t.Logf("setting max list items to %d", test.maxItems)
s.SetListMaxItems(test.maxItems)