Initial: Go app with tests + CI workflow
All checks were successful
CI / test (push) Successful in 1m45s

This commit is contained in:
Anton
2026-04-18 05:04:51 +00:00
parent ee6547f90c
commit 500e1605a6
4 changed files with 74 additions and 0 deletions

28
main_test.go Normal file
View File

@@ -0,0 +1,28 @@
package main
import "testing"
func TestAdd(t *testing.T) {
tests := []struct {
a, b, want int
}{
{2, 3, 5},
{0, 0, 0},
{-1, 1, 0},
{100, 200, 300},
}
for _, tt := range tests {
got := Add(tt.a, tt.b)
if got != tt.want {
t.Errorf("Add(%d, %d) = %d, want %d", tt.a, tt.b, got, tt.want)
}
}
}
func TestGreet(t *testing.T) {
got := Greet("World")
want := "Hello, World!"
if got != want {
t.Errorf("Greet(World) = %q, want %q", got, want)
}
}