예제 #1
0
파일: assert.go 프로젝트: ibmendoza/dgtk
func (s *Assert) FailIf(check bool, messages ...interface{}) {
	if check {
		if len(messages) == 0 {
			messages = append(messages, "failed!")
		}
		o := []string{}
		for _, m := range messages {
			o = append(o, fmt.Sprint(m))
		}
		tskip.Error(s.t, s.skip+1, strings.Join(o, " "))
		s.t.FailNow()
	}
}
예제 #2
0
func failIf(t *testing.T, check bool, messages ...interface{}) {
	if check {
		if len(messages) == 0 {
			messages = append(messages, "failed!")
		}
		o := []string{}
		for _, m := range messages {
			o = append(o, fmt.Sprint(m))
		}
		tskip.Error(t, 1, strings.Join(o, " "))
		t.FailNow()
	}
}