-
Notifications
You must be signed in to change notification settings - Fork 0
/
int64.go
44 lines (37 loc) · 961 Bytes
/
int64.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package assert
import (
"github.com/v2ray/v2ray-core/common/serial"
)
func (this *Assert) Int64(value int64) *Int64Subject {
return &Int64Subject{
Subject: Subject{
a: this,
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))
}
}