1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-02 09:17:55 -04:00
v2fly/testing/assert/subject.go
2016-05-24 21:55:46 +02:00

23 lines
464 B
Go

package assert
type Subject struct {
disp string
a *Assert
}
func (subject *Subject) Fail(verb string, other string) {
subject.FailWithMessage("Not true that " + subject.DisplayString() + " " + verb + " <" + other + ">.")
}
func (subject *Subject) FailWithMessage(message string) {
subject.a.Fail(message)
}
func (subject *Subject) DisplayString() string {
value := subject.disp
if len(value) == 0 {
value = "unknown"
}
return "<" + value + ">"
}