2021-11-01 00:24:26 +00:00
|
|
|
//stm: #unit
|
2019-07-10 15:10:45 +00:00
|
|
|
package repo
|
|
|
|
|
2019-07-18 14:01:39 +00:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
2019-07-10 15:10:45 +00:00
|
|
|
|
2022-03-11 06:27:36 +00:00
|
|
|
func genFsRepo(t *testing.T) *FsRepo {
|
|
|
|
path := t.TempDir()
|
2019-07-10 15:10:45 +00:00
|
|
|
|
|
|
|
repo, err := NewFS(path)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-07-18 14:01:39 +00:00
|
|
|
|
2019-11-12 17:59:38 +00:00
|
|
|
err = repo.Init(FullNode)
|
2019-07-18 14:01:39 +00:00
|
|
|
if err != ErrRepoExists && err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2022-03-11 06:27:36 +00:00
|
|
|
return repo
|
2019-07-10 15:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestFsBasic(t *testing.T) {
|
2022-03-11 06:27:36 +00:00
|
|
|
repo := genFsRepo(t)
|
2019-07-10 15:10:45 +00:00
|
|
|
basicTest(t, repo)
|
|
|
|
}
|