Move to subfolder

This commit is contained in:
2026-03-15 22:57:43 +01:00
parent 5ddfccf226
commit 3172b5db04
3 changed files with 0 additions and 0 deletions

33
hello/hello_test.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import "testing"
func TestHello(t *testing.T) {
t.Run("saying hello to people", func(t *testing.T) {
got := Hello("Hoborg", "")
want := "Hello, Hoborg"
assertMessage(t, got, want)
})
t.Run("say 'Hello, World' when an empty string is given", func(t *testing.T) {
got := Hello("", "")
want := "Hello, World"
assertMessage(t, got, want)
})
t.Run("hello in Spanish", func(t *testing.T) {
got := Hello("Elodie", "Spanish")
want := "Hola, Elodie"
assertMessage(t, got, want)
})
t.Run("hello in French", func(t *testing.T) {
got := Hello("Émile", "French")
want := "Bonjour, Émile"
assertMessage(t, got, want)
})
}
func assertMessage(t testing.TB, got, want string) {
t.Helper()
if got != want {
t.Errorf("got %q want %q", got, want)
}
}