| 151 | } |
| 152 | |
| 153 | func (s *PublishedStorageSuite) TestFilelistPlusWorkaround(c *C) { |
| 154 | s.storage.plusWorkaround = true |
| 155 | s.prefixedStorage.plusWorkaround = true |
| 156 | |
| 157 | paths := []string{"a", "b", "c", "testa", "test/a+1", "test/a 1", "lala/a+b", "lala/a b", "lala/c"} |
| 158 | for _, path := range paths { |
| 159 | s.PutFile(c, path, []byte("test")) |
| 160 | } |
| 161 | |
| 162 | list, err := s.storage.Filelist("") |
| 163 | c.Check(err, IsNil) |
| 164 | c.Check(list, DeepEquals, []string{"a", "b", "c", "lala/a+b", "lala/c", "test/a+1", "testa"}) |
| 165 | |
| 166 | list, err = s.storage.Filelist("test") |
| 167 | c.Check(err, IsNil) |
| 168 | c.Check(list, DeepEquals, []string{"a+1"}) |
| 169 | |
| 170 | list, err = s.storage.Filelist("test2") |
| 171 | c.Check(err, IsNil) |
| 172 | c.Check(list, DeepEquals, []string{}) |
| 173 | |
| 174 | list, err = s.prefixedStorage.Filelist("") |
| 175 | c.Check(err, IsNil) |
| 176 | c.Check(list, DeepEquals, []string{"a+b", "c"}) |
| 177 | } |
| 178 | |
| 179 | func (s *PublishedStorageSuite) TestRemove(c *C) { |
| 180 | s.PutFile(c, "a/b", []byte("test")) |