(t *testing.T)
| 45 | } |
| 46 | |
| 47 | func TestToStringKey(t *testing.T) { |
| 48 | cases := []struct { |
| 49 | values []interface{} |
| 50 | key string |
| 51 | }{ |
| 52 | {[]interface{}{"a"}, "a"}, |
| 53 | {[]interface{}{1, 2, 3}, "1_2_3"}, |
| 54 | {[]interface{}{1, nil, 3}, "1_nil_3"}, |
| 55 | {[]interface{}{[]interface{}{1, 2, 3}}, "[1 2 3]"}, |
| 56 | {[]interface{}{[]interface{}{"1", "2", "3"}}, "[1 2 3]"}, |
| 57 | {[]interface{}{[]interface{}{"1", nil, "3"}}, "[1 <nil> 3]"}, |
| 58 | } |
| 59 | for _, c := range cases { |
| 60 | if key := ToStringKey(c.values...); key != c.key { |
| 61 | t.Errorf("%v: expected %v, got %v", c.values, c.key, key) |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | func TestContains(t *testing.T) { |
| 67 | containsTests := []struct { |
nothing calls this directly
no test coverage detected