remove dependency on expect library

This commit is contained in:
Karl Seguin
2022-03-03 09:01:45 +08:00
parent 92cae1a07a
commit 95f74b4e85
9 changed files with 405 additions and 344 deletions

View File

@@ -3,22 +3,16 @@ package ccache
import (
"testing"
. "github.com/karlseguin/expect"
"github.com/karlseguin/ccache/v3/assert"
)
type ConfigurationTests struct{}
func Test_Configuration(t *testing.T) {
Expectify(new(ConfigurationTests), t)
}
func (_ *ConfigurationTests) BucketsPowerOf2() {
func Test_Configuration_BucketsPowerOf2(t *testing.T) {
for i := uint32(0); i < 31; i++ {
c := Configure[int]().Buckets(i)
if i == 1 || i == 2 || i == 4 || i == 8 || i == 16 {
Expect(c.buckets).ToEqual(int(i))
assert.Equal(t, c.buckets, int(i))
} else {
Expect(c.buckets).ToEqual(16)
assert.Equal(t, c.buckets, 16)
}
}
}