15 lines
263 B
Go
15 lines
263 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
/* Must be camelcase and start with "Test"
|
|
so Testsum will not work. sumTest will not work
|
|
*/
|
|
func TestSum(t *testing.T) {
|
|
total := sum(1, 7)
|
|
|
|
if total != 8 {
|
|
t.Errorf("Sum was incorrect, got: %d, want: %d.", total, 8)
|
|
}
|
|
}
|