about summary refs log tree commit diff
path: root/main/additions/additions_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'main/additions/additions_test.go')
-rw-r--r--main/additions/additions_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/main/additions/additions_test.go b/main/additions/additions_test.go
new file mode 100644
index 0000000..d62bc68
--- /dev/null
+++ b/main/additions/additions_test.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+	"os"
+	"testing"
+
+	"ci-visibility-test-github/main/civisibility/integrations/gotesting"
+)
+
+func TestMain(m *testing.M) {
+	// NOTE: This is the only needed thing to enable test visibility instrumentation.
+	os.Exit(gotesting.RunM(m))
+}
+
+func Test_AddNumbers(t *testing.T) {
+	ans := addNumbers(2, 5)
+
+	if ans != 7 {
+		t.Fatal("Expected 7 but instead got ", ans)
+	}
+}
+
+func Test_AddNumbers2(t *testing.T) {
+	ans := addNumbers(7, 5)
+
+	if ans != 12 {
+		t.Fatal("Expected 12 but instead got ", ans)
+	}
+}