1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00
v2fly/testing/assert/subject.go

23 lines
464 B
Go
Raw Normal View History

package assert
type Subject struct {
2016-05-24 15:55:46 -04:00
disp string
a *Assert
}
2016-05-24 15:55:46 -04:00
func (subject *Subject) Fail(verb string, other string) {
subject.FailWithMessage("Not true that " + subject.DisplayString() + " " + verb + " <" + other + ">.")
2015-12-02 10:19:39 -05:00
}
func (subject *Subject) FailWithMessage(message string) {
2016-05-24 15:55:46 -04:00
subject.a.Fail(message)
}
2016-05-24 15:55:46 -04:00
func (subject *Subject) DisplayString() string {
value := subject.disp
if len(value) == 0 {
value = "unknown"
}
2016-05-24 15:55:46 -04:00
return "<" + value + ">"
}