add gitea ci workflow
This commit is contained in:
24
calculator_test.go
Normal file
24
calculator_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package calculator
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestAdd(t *testing.T) {
|
||||
result := Add(2, 3)
|
||||
if result != 5 {
|
||||
t.Errorf("expected 5, got %d", result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubtract(t *testing.T) {
|
||||
result := Subtract(5, 3)
|
||||
if result != 2 {
|
||||
t.Errorf("expected 2, got %d", result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMultiply(t *testing.T) {
|
||||
result := Multiply(4, 3)
|
||||
if result != 12 {
|
||||
t.Errorf("expected 12, got %d", result)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user