Add bucket lifecycle expiry feature (#7834)

This commit is contained in:
Anis Elleuch
2019-08-09 18:02:41 +01:00
committed by Harshavardhana
parent a8296445ad
commit 1ce8d2c476
17 changed files with 499 additions and 39 deletions
+23
View File
@@ -479,3 +479,26 @@ func TestQueries(t *testing.T) {
}
}
}
func TestLCP(t *testing.T) {
var testCases = []struct {
prefixes []string
commonPrefix string
}{
{[]string{"", ""}, ""},
{[]string{"a", "b"}, ""},
{[]string{"a", "a"}, "a"},
{[]string{"a/", "a/"}, "a/"},
{[]string{"abcd/", ""}, ""},
{[]string{"abcd/foo/", "abcd/bar/"}, "abcd/"},
{[]string{"abcd/foo/bar/", "abcd/foo/bar/zoo"}, "abcd/foo/bar/"},
}
for i, test := range testCases {
foundPrefix := lcp(test.prefixes)
if foundPrefix != test.commonPrefix {
t.Fatalf("Test %d: Common prefix found: `%v`, expected: `%v`", i+1, foundPrefix, test.commonPrefix)
}
}
}