File: configuration_test.go

package info (click to toggle)
golang-github-karlseguin-ccache 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 156 kB
  • sloc: makefile: 6
file content (23 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package ccache

import (
	. "github.com/karlseguin/expect"
	"testing"
)

type ConfigurationTests struct{}

func Test_Configuration(t *testing.T) {
	Expectify(new(ConfigurationTests), t)
}

func (_ *ConfigurationTests) BucketsPowerOf2() {
	for i := uint32(0); i < 31; i++ {
		c := Configure().Buckets(i)
		if i == 1 || i == 2 || i == 4 || i == 8 || i == 16 {
			Expect(c.buckets).ToEqual(int(i))
		} else {
			Expect(c.buckets).ToEqual(16)
		}
	}
}