mirror of https://github.com/v2ray/v2ray-core
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.
33 lines
772 B
33 lines
772 B
package unit
|
|
|
|
type StringSubject struct {
|
|
*Subject
|
|
value string
|
|
}
|
|
|
|
func NewStringSubject(base *Subject, value string) *StringSubject {
|
|
subject := new(StringSubject)
|
|
subject.Subject = base
|
|
subject.value = value
|
|
return subject
|
|
}
|
|
|
|
func (subject *StringSubject) Named(name string) *StringSubject {
|
|
subject.Subject.Named(name)
|
|
return subject
|
|
}
|
|
|
|
func (subject *StringSubject) Fail(verb string, other string) {
|
|
subject.FailWithMessage("Not true that " + subject.DisplayString() + " " + verb + " <" + other + ">.")
|
|
}
|
|
|
|
func (subject *StringSubject) DisplayString() string {
|
|
return subject.Subject.DisplayString(subject.value)
|
|
}
|
|
|
|
func (subject *StringSubject) Equals(expectation string) {
|
|
if subject.value != expectation {
|
|
subject.Fail("is equal to", expectation)
|
|
}
|
|
}
|