6720535fab
case which we can optimize out by being more explicit when we create a new item
14 lines
272 B
Go
14 lines
272 B
Go
package ccache
|
|
|
|
import (
|
|
"testing"
|
|
"github.com/viki-org/gspec"
|
|
)
|
|
|
|
func TestItemPromotability(t *testing.T) {
|
|
spec := gspec.New(t)
|
|
item := &Item{promotions: 4}
|
|
spec.Expect(item.shouldPromote(5)).ToEqual(true)
|
|
spec.Expect(item.shouldPromote(5)).ToEqual(false)
|
|
}
|