Exemple #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")
	}
}
Exemple #2
0
func checkTrue(is *testy.T, cond bool) {
	if !cond {
		is.Uplevel(1).Error("Expression was not true")
	}
}
Exemple #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")
	}
}