diff --git a/main.go b/main.go index c22d207..0190ecd 100644 --- a/main.go +++ b/main.go @@ -19,5 +19,5 @@ func main() { d := subtractNumbers(1, 2) m := multiplyNumbers(1, 2) fmt.Printf("sum is %d, difference is %d, multiplied %d", s, d, m) - fmt.Println("end") + fmt.Printf("sum is %d, difference is %d, multiplied %d", s, d, m) } diff --git a/main_test.go b/main_test.go index e6dce39..2aec924 100644 --- a/main_test.go +++ b/main_test.go @@ -8,3 +8,17 @@ func TestAddNumbers(t *testing.T) { t.Errorf("addNumbers(1, 2) = %d; want 3", result) } } + +func TestSubtractNumbers(t *testing.T) { + result := subtractNumbers(1, 2) + if result != -1 { + t.Errorf("subtractNumbers(1, 2) = %d; want -1", result) + } +} + +func TestMultiplyNumbers(t *testing.T) { + result := multiplyNumbers(1, 2) + if result != 2 { + t.Errorf("multiplyNumbers(1, 2) = %d; want 2", result) + } +}