go-by-test/sum/sum_test.go
2024-09-10 21:15:12 +02:00

15 lines
213 B
Go

package sum
import "testing"
func TestSum(t *testing.T) {
numbers := [5]int{1, 2, 3, 4, 5}
got := Sum(numbers)
exp := 15
if got != exp {
t.Errorf("got %d, expected %d, given %v", got, exp, numbers)
}
}