Skip to content

Commit fa71646

Browse files
committed
add tests for prefix+marker case
1 parent 75237ca commit fa71646

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

backends/s3/s3_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,14 @@ func TestBackend_globalprefix(t *testing.T) {
110110
b.opt.GlobalPrefix = "v5/"
111111

112112
tester.DoBackendTests(t, b)
113-
assert.Len(t, b.lastMarker, 0)
113+
assert.Empty(t, b.lastMarker)
114+
115+
b = getBackend(ctx, t)
116+
b.opt.GlobalPrefix = "v6/"
117+
b.opt.UseUpdateMarker = true
118+
119+
tester.DoBackendTests(t, b)
120+
assert.NotEmpty(t, b.lastMarker)
114121
}
115122

116123
func TestBackend_recursive(t *testing.T) {

tester/tester.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/PowerDNS/simpleblob"
99
"github.com/stretchr/testify/assert"
10+
"github.com/stretchr/testify/require"
1011
)
1112

1213
// DoBackendTests tests a backend for conformance
@@ -41,6 +42,7 @@ func DoBackendTests(t *testing.T, b simpleblob.Interface) {
4142
ls, err = b.List(ctx, "foo-")
4243
assert.NoError(t, err)
4344
assert.Equal(t, ls.Names(), []string{"foo-1"})
45+
require.NotEmpty(t, ls)
4446
assert.Equal(t, ls[0].Size, int64(3))
4547
ls, err = b.List(ctx, "bar-")
4648
assert.NoError(t, err)

0 commit comments

Comments
 (0)