diff --git a/src/provider.go b/src/provider.go index e938c3e..a944128 100644 --- a/src/provider.go +++ b/src/provider.go @@ -128,7 +128,7 @@ func (p Provider) raw (s string) string { argsStart := strings.Index(parts[2], "(") argsEnd := strings.Index(parts[2], ")") if argsStart == -1 || argsEnd == -1 || argsEnd < argsStart { - // TODO: Cover this with logging + logger.Error("Could not identify arguments for " + parts[2]) return "" } diff --git a/src/provider_test.go b/src/provider_test.go index 9521aaa..2819226 100644 --- a/src/provider_test.go +++ b/src/provider_test.go @@ -46,8 +46,8 @@ func TestGet(t *testing.T) { t.Errorf("Unsupported method not handled correctly") } - r7 := provider.Get("faker.Internet().Slug") - if r7 != "" { - t.Errorf("Got a value and was expecting empty string") + _ = provider.Get("faker.Internet().Slug") + if hook.LastEntry().Message != "Could not identify arguments for Slug" { + t.Errorf("Malformed arguments not handled correctly") } } \ No newline at end of file