Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename *test.Test* identifiers #3260

Merged
merged 15 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cache/cachetest/cacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (
"github.com/ava-labs/avalanchego/ids"
)

const TestIntSize = ids.IDLen + 8
const IntSize = ids.IDLen + 8

func TestIntSizeFunc(ids.ID, int64) int {
return TestIntSize
func IntSizeFunc(ids.ID, int64) int {
return IntSize
}

// CacherTests is a list of all Cacher tests
var CacherTests = []struct {
// Tests is a list of all Cacher tests
var Tests = []struct {
Size int
Func func(t *testing.T, c cache.Cacher[ids.ID, int64])
}{
Expand Down
4 changes: 2 additions & 2 deletions cache/lru_sized_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import (
)

func TestSizedLRU(t *testing.T) {
cache := NewSizedLRU[ids.ID, int64](cachetest.TestIntSize, cachetest.TestIntSizeFunc)
cache := NewSizedLRU[ids.ID, int64](cachetest.IntSize, cachetest.IntSizeFunc)

cachetest.TestBasic(t, cache)
}

func TestSizedLRUEviction(t *testing.T) {
cache := NewSizedLRU[ids.ID, int64](2*cachetest.TestIntSize, cachetest.TestIntSizeFunc)
cache := NewSizedLRU[ids.ID, int64](2*cachetest.IntSize, cachetest.IntSizeFunc)

cachetest.TestEviction(t, cache)
}
Expand Down
4 changes: 2 additions & 2 deletions cache/metercacher/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func TestInterface(t *testing.T) {
{
description: "sized cache LRU",
setup: func(size int) cache.Cacher[ids.ID, int64] {
return cache.NewSizedLRU[ids.ID, int64](size*cachetest.TestIntSize, cachetest.TestIntSizeFunc)
return cache.NewSizedLRU[ids.ID, int64](size*cachetest.IntSize, cachetest.IntSizeFunc)
},
},
}

for _, scenario := range scenarios {
for _, test := range cachetest.CacherTests {
for _, test := range cachetest.Tests {
baseCache := scenario.setup(test.Size)
c, err := New("", prometheus.NewRegistry(), baseCache)
require.NoError(t, err)
Expand Down
Loading
Loading