You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/testing/assert/intsubject.go

39 lines
758 B

package assert
import (
"v2ray.com/core/common/serial"
)
9 years ago
func (this *Assert) Int(value int) *IntSubject {
return &IntSubject{
Subject: Subject{
a: this,
disp: serial.IntToString(value),
},
value: value,
}
}
type IntSubject struct {
Subject
9 years ago
value int
}
func (subject *IntSubject) Equals(expectation int) {
9 years ago
if subject.value != expectation {
subject.Fail("is equal to", serial.IntToString(expectation))
}
}
func (subject *IntSubject) GreaterThan(expectation int) {
9 years ago
if subject.value <= expectation {
subject.Fail("is greater than", serial.IntToString(expectation))
}
}
func (subject *IntSubject) LessThan(expectation int) {
9 years ago
if subject.value >= expectation {
subject.Fail("is less than", serial.IntToString(expectation))
}
}