Esempio n. 1
0
func checkEvenPositive(is *testy.T, n int) {
	// replace 'is' with a labeled, upleveled equivalent
	is = is.Uplevel(1).Label("Testing", n)

	if n < 1 {
		is.Error("was not positive")
	}
	if n%2 != 0 {
		is.Error("was not even")
	}
}
Esempio n. 2
0
func checkTrue(is *testy.T, cond bool) {
	if !cond {
		is.Uplevel(1).Error("Expression was not true")
	}
}
Esempio n. 3
0
func checkEven(is *testy.T, n int) {
	is = is.Uplevel(1).Label("Testing", n)
	if n%2 != 0 {
		is.Error("Value is not even")
	}
}