Add test for case-sensitive DeleteByPath

This commit is contained in:
Deluan 2020-07-14 15:35:42 -04:00
parent 8b20c26e04
commit d14a6031f0
1 changed files with 3 additions and 0 deletions

View File

@ -102,12 +102,15 @@ var _ = Describe("MediaRepository", func() {
Expect(mr.Put(&model.MediaFile{ID: id3, Path: P("/ab_/" + id3 + ".mp3")})).To(BeNil())
id4 := "4444"
Expect(mr.Put(&model.MediaFile{ID: id4, Path: P("/abc/" + id4 + ".mp3")})).To(BeNil())
id5 := "5555"
Expect(mr.Put(&model.MediaFile{ID: id5, Path: P("/Ab_/" + id5 + ".mp3")})).To(BeNil())
Expect(mr.DeleteByPath(P("/ab_"))).To(Equal(int64(1)))
Expect(mr.Get(id1)).ToNot(BeNil())
Expect(mr.Get(id2)).ToNot(BeNil())
Expect(mr.Get(id4)).ToNot(BeNil())
Expect(mr.Get(id5)).ToNot(BeNil())
_, err := mr.Get(id3)
Expect(err).To(MatchError(model.ErrNotFound))
})