Skip to content

Commit 07103ba

Browse files
author
Daniel Fuentes
committed
add test that list does not match prefixes
1 parent 16fc0a0 commit 07103ba

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

store/ssmstore_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,16 @@ func TestList(t *testing.T) {
292292
assert.Equal(t, "value", *secret.Value)
293293
}
294294
})
295+
296+
t.Run("List should only return exact matches on service name", func(t *testing.T) {
297+
store.Write(SecretId{Service: "match", Key: "a"}, "val")
298+
store.Write(SecretId{Service: "matchlonger", Key: "a"}, "val")
299+
300+
s, err := store.List("match", false)
301+
assert.Nil(t, err)
302+
assert.Equal(t, 1, len(s))
303+
assert.Equal(t, "match.a", s[0].Meta.Key)
304+
})
295305
}
296306

297307
func TestHistory(t *testing.T) {

0 commit comments

Comments
 (0)