Skip to content

Commit

Permalink
fix: make coverage happy
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Jan 6, 2025
1 parent d19d089 commit e530049
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tm2/pkg/bft/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,28 @@ func TestConfig_ValidateBaseConfig(t *testing.T) {
assert.ErrorIs(t, c.BaseConfig.ValidateBasic(), errInvalidProfListenAddress)
})
}

func TestConfig_DBDir(t *testing.T) {
t.Parallel()

t.Run("DB path is absolute", func(t *testing.T) {
t.Parallel()

c := DefaultConfig()
c.RootDir = "/root"
c.DBPath = "/abs/path"

assert.Equal(t, c.DBPath, c.DBDir())
assert.NotEqual(t, filepath.Join(c.RootDir, c.DBPath), c.DBDir())
})

t.Run("DB path is relative", func(t *testing.T) {
t.Parallel()

c := DefaultConfig()
c.RootDir = "/root"
c.DBPath = "relative/path"

assert.Equal(t, filepath.Join(c.RootDir, c.DBPath), c.DBDir())
})
}

0 comments on commit e530049

Please sign in to comment.