diff --git a/tests/storager_list.go b/tests/storager_list.go index 513e9e5ba..1d253c6b0 100644 --- a/tests/storager_list.go +++ b/tests/storager_list.go @@ -84,8 +84,20 @@ func (s *storageListSuite) TestListWithoutListMode() { } func (s *storageListSuite) TestListEmptyDir() { + if !s.p.store.Features().CreateDir { + s.T().Skipf("store doesn't support CreateDir, skip TestListEmptyDir.") + } + path := uuid.New().String() + _, err := s.p.store.CreateDir(path) + s.NoError(err) + + defer func() { + err = s.p.store.Delete(path, ps.WithObjectMode(types.ModeDir)) + s.NoError(err) + }() + it, err := s.p.store.List(path, ps.WithListMode(types.ListModeDir)) s.NoError(err) s.NotNil(it)