From 9ca7c35db323ee66da18c7e39f6105f813339468 Mon Sep 17 00:00:00 2001 From: harishagrawal Date: Tue, 12 Sep 2023 08:57:17 +0000 Subject: [PATCH 1/3] 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= From ee0697a3f2d286f61930ca7a893b2351a8fc0654 Mon Sep 17 00:00:00 2001 From: harishagrawal Date: Tue, 12 Sep 2023 09:13:13 +0000 Subject: [PATCH 2/3] Test generated by RoostGPT for test go-email using AI Type Open AI and AI Model gpt-4 --- Add_28d8c9c450_test.go | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Add_28d8c9c450_test.go b/Add_28d8c9c450_test.go index 5b64e10..0ae6642 100644 --- a/Add_28d8c9c450_test.go +++ b/Add_28d8c9c450_test.go @@ -1,39 +1,48 @@ -// Test generated by RoostGPT for test go-email using AI Type Open AI and AI Model gpt-4 - package main -import "testing" +import ( + "testing" + "log" +) -func TestAdd_28d8c9c450(t *testing.T) { +func TestAdd(t *testing.T) { t.Run("positive numbers", func(t *testing.T) { - result := Add_28d8c9c450(2, 3) + result := Add(2, 3) if result != 5 { t.Errorf("Expected 5, but got %d", result) + } else { + log.Println("Success: TestAdd for positive numbers passed.") } }) t.Run("negative numbers", func(t *testing.T) { - result := Add_28d8c9c450(-2, -3) + result := Add(-2, -3) if result != -5 { t.Errorf("Expected -5, but got %d", result) + } else { + log.Println("Success: TestAdd for negative numbers passed.") } }) t.Run("zero", func(t *testing.T) { - result := Add_28d8c9c450(0, 0) + result := Add(0, 0) if result != 0 { t.Errorf("Expected 0, but got %d", result) + } else { + log.Println("Success: TestAdd for zero passed.") } }) t.Run("positive and negative", func(t *testing.T) { - result := Add_28d8c9c450(2, -3) + result := Add(2, -3) if result != -1 { t.Errorf("Expected -1, but got %d", result) + } else { + log.Println("Success: TestAdd for positive and negative passed.") } }) } -func Add_28d8c9c450(a, b int) int { +func Add(a, b int) int { return a + b } From 669ae61a6b4367dc69d53a087614ea07c0e92fcf Mon Sep 17 00:00:00 2001 From: harishagrawal Date: Tue, 12 Sep 2023 09:19:00 +0000 Subject: [PATCH 3/3] Test generated by RoostGPT for test go-email using AI Type Open AI and AI Model gpt-4 --- Add_28d8c9c450_test.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Add_28d8c9c450_test.go b/Add_28d8c9c450_test.go index 0ae6642..053d3f4 100644 --- a/Add_28d8c9c450_test.go +++ b/Add_28d8c9c450_test.go @@ -2,47 +2,46 @@ package main import ( "testing" - "log" ) -func TestAdd(t *testing.T) { +func TestAdd_28d8c9c450(t *testing.T) { t.Run("positive numbers", func(t *testing.T) { - result := Add(2, 3) + result := Add_28d8c9c450(2, 3) if result != 5 { t.Errorf("Expected 5, but got %d", result) } else { - log.Println("Success: TestAdd for positive numbers passed.") + t.Log("Success: TestAdd_28d8c9c450 for positive numbers passed.") } }) t.Run("negative numbers", func(t *testing.T) { - result := Add(-2, -3) + result := Add_28d8c9c450(-2, -3) if result != -5 { t.Errorf("Expected -5, but got %d", result) } else { - log.Println("Success: TestAdd for negative numbers passed.") + t.Log("Success: TestAdd_28d8c9c450 for negative numbers passed.") } }) t.Run("zero", func(t *testing.T) { - result := Add(0, 0) + result := Add_28d8c9c450(0, 0) if result != 0 { t.Errorf("Expected 0, but got %d", result) } else { - log.Println("Success: TestAdd for zero passed.") + t.Log("Success: TestAdd_28d8c9c450 for zero passed.") } }) t.Run("positive and negative", func(t *testing.T) { - result := Add(2, -3) + result := Add_28d8c9c450(2, -3) if result != -1 { t.Errorf("Expected -1, but got %d", result) } else { - log.Println("Success: TestAdd for positive and negative passed.") + t.Log("Success: TestAdd_28d8c9c450 for positive and negative passed.") } }) } -func Add(a, b int) int { +func Add_28d8c9c450(a, b int) int { return a + b }