package api import ( "testing" ) func TestAllocs_List(t *testing.T) { c, s := makeClient(t, nil, nil) defer s.Stop() a := c.Allocs() // Querying when no allocs exist returns nothing allocs, qm, err := a.List() if err != nil { t.Fatalf("err: %s", err) } if qm.LastIndex != 0 { t.Fatalf("bad index: %d", qm.LastIndex) } if n := len(allocs); n != 0 { t.Fatalf("expected 0 allocs, got: %d", n) } }