go-by-test/dictionary/dictionary_test.go
2024-09-11 15:22:42 +02:00

21 lines
378 B
Go

package dictionary
import "testing"
func assertStrings(t testing.TB, got, want string) {
t.Helper()
if got != want {
t.Errorf("got %q want %q given %q", got, want, "test")
}
}
func TestSearch(t *testing.T) {
dictionary := Dictionary{"test": "this is just a test"}
got := dictionary.Search("test")
want := "this is just a test"
assertStrings(t, got, want)
}