18 lines
241 B
Go
18 lines
241 B
Go
package greet
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
)
|
|
|
|
func TestGreet(t *testing.T) {
|
|
buffer := bytes.Buffer{}
|
|
Greet(&buffer, "Chris")
|
|
got := buffer.String()
|
|
want := "Hello, Chris"
|
|
|
|
if got != want {
|
|
t.Errorf("got %q want %q", got, want)
|
|
}
|
|
}
|