MCPcopy Create free account
hub / github.com/chain/Core / TestFormatKey

Function TestFormatKey

log/log_test.go:322–341  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

320}
321
322func TestFormatKey(t *testing.T) {
323 examples := []struct {
324 key interface{}
325 want string
326 }{
327 {"hello", "hello"},
328 {"hello world", "hello-world"},
329 {"", "?"},
330 {true, "true"},
331 {"a b\"c\nd;e\tf龜g", "a-b-c-d-e-f龜g"},
332 }
333
334 for i, ex := range examples {
335 t.Log("Example", i)
336 got := formatKey(ex.key)
337 if got != ex.want {
338 t.Errorf("formatKey(%#v) = %q want %q", ex.key, got, ex.want)
339 }
340 }
341}
342
343func TestFormatValue(t *testing.T) {
344 examples := []struct {

Callers

nothing calls this directly

Calls 2

formatKeyFunction · 0.85
LogMethod · 0.80

Tested by

no test coverage detected