Ejemplo n.º 1
0
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
	}
}
Ejemplo n.º 2
0
func Int(value int) *IntSubject {
	return &IntSubject{value: serial.IntLiteral(value)}
}
Ejemplo n.º 3
0
func (subject *IntSubject) LessThan(expectation int) {
	if subject.value.Value() >= expectation {
		subject.Fail(subject.DisplayString(), "is less than", serial.IntLiteral(expectation))
	}
}
Ejemplo n.º 4
0
func (subject *IntSubject) GreaterThan(expectation int) {
	if subject.value.Value() <= expectation {
		subject.Fail(subject.DisplayString(), "is greater than", serial.IntLiteral(expectation))
	}
}
Ejemplo n.º 5
0
func (subject *IntSubject) Equals(expectation int) {
	if subject.value.Value() != expectation {
		subject.Fail(subject.DisplayString(), "is equal to", serial.IntLiteral(expectation))
	}
}