1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/joezou-tug

Клонировать/Скачать
macher.go 636
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
joezou Отправлено 26.11.2017 16:38 f9d7c5a
package tug
import (
"fmt"
)
type Matcher interface {
//run match
Match(actual interface{}) bool
//get fail reason
FailReason(actual interface{}) string
//get negation fail reason
NegationFailReason(actual interface{}) string
}
type BaseMatcher struct {
Expected interface{}
Reason string
}
func (this *BaseMatcher) Match(actual interface{}) bool {
return true
}
func (this *BaseMatcher)FailReason(actual interface{})string {
return fmt.Sprintf(this.Reason,actual,LOGIC_NOT,this.Expected)
}
func (this *BaseMatcher)NegationFailReason(actual interface{})string {
return fmt.Sprintf(this.Reason,actual,this.Expected)
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/joezou-tug.git
git@api.gitlife.ru:oschina-mirror/joezou-tug.git
oschina-mirror
joezou-tug
joezou-tug
master