package main import ( "bytes" "strings" "testing" ) func TestGreeterHelloPrintsAppName(t *testing.T) { var buf bytes.Buffer if err := run([]string{"greeter:hello"}, &buf); err != nil { t.Fatalf("greeter:hello: %v", err) } if got := strings.TrimSpace(buf.String()); got != "hello-app" { t.Fatalf("output = %q, want %q", got, "hello-app") } }