...

Source file src/github.com/launchdarkly/ccache/configuration_test.go

Documentation: github.com/launchdarkly/ccache

     1  package ccache
     2  
     3  import (
     4  	"testing"
     5  
     6  	. "github.com/karlseguin/expect"
     7  )
     8  
     9  type ConfigurationTests struct{}
    10  
    11  func Test_Configuration(t *testing.T) {
    12  	Expectify(new(ConfigurationTests), t)
    13  }
    14  
    15  func (_ *ConfigurationTests) BucketsPowerOf2() {
    16  	for i := uint32(0); i < 31; i++ {
    17  		c := Configure().Buckets(i)
    18  		if i == 1 || i == 2 || i == 4 || i == 8 || i == 16 {
    19  			Expect(c.buckets).ToEqual(int(i))
    20  		} else {
    21  			Expect(c.buckets).ToEqual(16)
    22  		}
    23  	}
    24  }
    25  

View as plain text