package helloworld import "testing" func TestHello(t *testing.T) { initDefaults() t.Run("Hello someone", func(t *testing.T) { got := Hello("Jason", "English") exp := "Hello Jason" assertCorrectMsg(t, got, exp) }) t.Run("Hello default", func(t *testing.T) { got := Hello("", "English") exp := "Hello world" assertCorrectMsg(t, got, exp) }) t.Run("Hello default", func(t *testing.T) { got := Hello("Elodie", "Spanish") exp := "Hola Elodie" assertCorrectMsg(t, got, exp) }) } func assertCorrectMsg(t testing.TB, got, exp string) { t.Helper() if got != exp { t.Errorf("got %q expected %q", got, exp) } }