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

Function TestFormatKey

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

Source from the content-addressed store, hash-verified

354}
355
356func TestFormatKey(t *testing.T) {
357 examples := []struct {
358 key interface{}
359 want string
360 }{
361 {"hello", "hello"},
362 {"hello world", "hello-world"},
363 {"", "?"},
364 {true, "true"},
365 {"a b\"c\nd;e\tf龜g", "a-b-c-d-e-f龜g"},
366 }
367
368 for i, ex := range examples {
369 t.Log("Example", i)
370 got := formatKey(ex.key)
371 if got != ex.want {
372 t.Errorf("formatKey(%#v) = %q want %q", ex.key, got, ex.want)
373 }
374 }
375}
376
377func TestFormatValue(t *testing.T) {
378 examples := []struct {

Callers

nothing calls this directly

Calls 1

formatKeyFunction · 0.85

Tested by

no test coverage detected