(t *testing.T)
| 354 | } |
| 355 | |
| 356 | func 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 | |
| 377 | func TestFormatValue(t *testing.T) { |
| 378 | examples := []struct { |
nothing calls this directly
no test coverage detected