Test suite for a Repo implementation
(t *testing.T, creator RepoCreator)
| 15 | |
| 16 | // Test suite for a Repo implementation |
| 17 | func RepoTest(t *testing.T, creator RepoCreator) { |
| 18 | for bare, name := range map[bool]string{ |
| 19 | false: "Plain", |
| 20 | true: "Bare", |
| 21 | } { |
| 22 | t.Run(name, func(t *testing.T) { |
| 23 | repo := creator(t, bare) |
| 24 | |
| 25 | t.Run("Data", func(t *testing.T) { |
| 26 | RepoDataTest(t, repo) |
| 27 | RepoDataSignatureTest(t, repo) |
| 28 | }) |
| 29 | |
| 30 | t.Run("Config", func(t *testing.T) { |
| 31 | RepoConfigTest(t, repo) |
| 32 | }) |
| 33 | |
| 34 | t.Run("Storage", func(t *testing.T) { |
| 35 | RepoStorageTest(t, repo) |
| 36 | }) |
| 37 | |
| 38 | t.Run("Index", func(t *testing.T) { |
| 39 | RepoIndexTest(t, repo) |
| 40 | }) |
| 41 | |
| 42 | t.Run("Clocks", func(t *testing.T) { |
| 43 | RepoClockTest(t, repo) |
| 44 | }) |
| 45 | }) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | // helper to test a RepoConfig |
| 50 | func RepoConfigTest(t *testing.T, repo RepoConfig) { |