Files
2026-08-31 14:57:35 -04:00

31 lines
479 B
Go

package hello
import (
"testing"
)
func TestSayHello(t *testing.T) {
subtests := []struct {
items []string
result string
}{
{
result: "Hello, world!",
},
{
items: []string{"Leena"},
result: "Hello, Leena!",
},
{
items: []string{"Zack", "Sami", "Sara"},
result: "Hello, Zack, Sami, Sara!",
},
}
for _, st := range subtests {
if s := Say(st.items); s != st.result {
t.Errorf("wanted %s (%v), got %s", st.result, st.items, s)
}
}
}