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/int64.go

45 lines
942 B

9 years ago
package assert
import (
"v2ray.com/core/common/serial"
9 years ago
)
8 years ago
func (v *Assert) Int64(value int64) *Int64Subject {
9 years ago
return &Int64Subject{
Subject: Subject{
8 years ago
a: v,
9 years ago
disp: serial.Int64ToString(value),
},
value: value,
}
}
type Int64Subject struct {
Subject
value int64
}
func (subject *Int64Subject) Equals(expectation int64) {
if subject.value != expectation {
subject.Fail("is equal to", serial.Int64ToString(expectation))
}
}
func (subject *Int64Subject) GreaterThan(expectation int64) {
if subject.value <= expectation {
subject.Fail("is greater than", serial.Int64ToString(expectation))
}
}
func (subject *Int64Subject) AtMost(expectation int64) {
if subject.value > expectation {
subject.Fail("is at most", serial.Int64ToString(expectation))
}
}
func (subject *Int64Subject) AtLeast(expectation int64) {
if subject.value < expectation {
subject.Fail("is at least", serial.Int64ToString(expectation))
}
}