Add test for FS store driver

This commit is contained in:
Maurizio Porrato 2021-05-15 19:54:09 +01:00
parent 934270bd7a
commit c1049eb48e
Signed by: guru
GPG Key ID: C622977DF024AC24
1 changed files with 11 additions and 2 deletions

View File

@ -6,8 +6,7 @@ import (
"time"
)
func TestStore(t *testing.T) {
drv, _ := NewMemStore()
func testStore_helper(t *testing.T, drv StoreDriver) {
store := NewStore(drv)
v1 := "0.1.2"
@ -77,6 +76,16 @@ func TestStore(t *testing.T) {
}
}
func TestStore_Mem(t *testing.T) {
drv, _ := NewMemStore()
testStore_helper(t, drv)
}
func TestStore_FS(t *testing.T) {
drv, _ := NewFSStore(t.TempDir())
testStore_helper(t, drv)
}
func benchCreate_helper(b *testing.B, drv StoreDriver) {
store := NewStore(drv)