package testing
import (
"fmt"
"testing"
)
func TestCalc(t *testing.T){
inputs := [...]int{1,2,3}
expected := [...]int{1,2,9}
for i:=0 ; i <len(inputs);i++{
ret := calc(inputs[i])
if ret != expected[i]{
t.Errorf("input is %d,the expected is %d actual %d",inputs[i],expected[i],ret)
}
}
}
func TestErrorInCode(t *testing.T){
fmt.Println("start")
t.Error("ERROR")
//t.Fatal("error")
fmt.Println("end")
}