From 9ca7c35db323ee66da18c7e39f6105f813339468 Mon Sep 17 00:00:00 2001 From: harishagrawal Date: Tue, 12 Sep 2023 08:57:17 +0000 Subject: [PATCH] Test generated by RoostGPT for test go-email using AI Type Open AI and AI Model gpt-4 --- Add_28d8c9c450_test.go | 39 +++++++++++++++++++++++++++++++++++++++ go.mod | 11 +++++++++++ go.sum | 8 ++++++++ 3 files changed, 58 insertions(+) create mode 100644 Add_28d8c9c450_test.go create mode 100644 go.mod create mode 100644 go.sum diff --git a/Add_28d8c9c450_test.go b/Add_28d8c9c450_test.go new file mode 100644 index 0000000..5b64e10 --- /dev/null +++ b/Add_28d8c9c450_test.go @@ -0,0 +1,39 @@ +// Test generated by RoostGPT for test go-email using AI Type Open AI and AI Model gpt-4 + +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) + } + }) + + t.Run("negative numbers", func(t *testing.T) { + result := Add_28d8c9c450(-2, -3) + if result != -5 { + t.Errorf("Expected -5, but got %d", result) + } + }) + + t.Run("zero", func(t *testing.T) { + result := Add_28d8c9c450(0, 0) + if result != 0 { + t.Errorf("Expected 0, but got %d", result) + } + }) + + 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) + } + }) +} + +func Add_28d8c9c450(a, b int) int { + return a + b +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..40ec89a --- /dev/null +++ b/go.mod @@ -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 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..7fea79b --- /dev/null +++ b/go.sum @@ -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=