Merge pull request #1 from harishagrawal/roost-1694508948

Test generated by RoostGPT for test go-email using AI Type Open AI and AI Model gpt-4
pull/18/head
Harish Agrawal 2023-09-12 15:09:17 +05:30 committed by GitHub
commit 2ee8876ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 66 additions and 0 deletions

47
Add_28d8c9c450_test.go Normal file
View File

@ -0,0 +1,47 @@
package main
import (
"testing"
)
func TestAdd_28d8c9c450(t *testing.T) {
t.Run("positive numbers", func(t *testing.T) {
result := Add_28d8c9c450(2, 3)
if result != 5 {
t.Errorf("Expected 5, but got %d", result)
} else {
t.Log("Success: TestAdd_28d8c9c450 for positive numbers passed.")
}
})
t.Run("negative numbers", func(t *testing.T) {
result := Add_28d8c9c450(-2, -3)
if result != -5 {
t.Errorf("Expected -5, but got %d", result)
} else {
t.Log("Success: TestAdd_28d8c9c450 for negative numbers passed.")
}
})
t.Run("zero", func(t *testing.T) {
result := Add_28d8c9c450(0, 0)
if result != 0 {
t.Errorf("Expected 0, but got %d", result)
} else {
t.Log("Success: TestAdd_28d8c9c450 for zero passed.")
}
})
t.Run("positive and negative", func(t *testing.T) {
result := Add_28d8c9c450(2, -3)
if result != -1 {
t.Errorf("Expected -1, but got %d", result)
} else {
t.Log("Success: TestAdd_28d8c9c450 for positive and negative passed.")
}
})
}
func Add_28d8c9c450(a, b int) int {
return a + b
}

11
go.mod Normal file
View File

@ -0,0 +1,11 @@
module learning-golang
go 1.19
require github.com/smartystreets/goconvey v1.8.1
require (
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/smarty/assertions v1.15.0 // indirect
)

8
go.sum Normal file
View File

@ -0,0 +1,8 @@
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY=
github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec=
github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY=
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=