func ChunkKeyGenerator(iv []byte) func() []byte { chunkId := 0 return func() []byte { newKey := make([]byte, 0, len(iv)+4) newKey = append(newKey, iv...) newKey = append(newKey, serial.IntLiteral(chunkId).Bytes()...) chunkId++ return newKey } }
func Int(value int) *IntSubject { return &IntSubject{value: serial.IntLiteral(value)} }
func (subject *IntSubject) LessThan(expectation int) { if subject.value.Value() >= expectation { subject.Fail(subject.DisplayString(), "is less than", serial.IntLiteral(expectation)) } }
func (subject *IntSubject) GreaterThan(expectation int) { if subject.value.Value() <= expectation { subject.Fail(subject.DisplayString(), "is greater than", serial.IntLiteral(expectation)) } }
func (subject *IntSubject) Equals(expectation int) { if subject.value.Value() != expectation { subject.Fail(subject.DisplayString(), "is equal to", serial.IntLiteral(expectation)) } }