(t *testing.T)
| 117 | } |
| 118 | |
| 119 | func TestMixedArrayFromString(t *testing.T) { |
| 120 | b80 := byte('\x80') |
| 121 | tests := []struct { |
| 122 | in string |
| 123 | want []interface{} |
| 124 | }{ |
| 125 | {"foo", []interface{}{"foo"}}, |
| 126 | {"\x80foo", []interface{}{b80, "foo"}}, |
| 127 | {"foo\x80foo", []interface{}{"foo", b80, "foo"}}, |
| 128 | {"foo\x80", []interface{}{"foo", b80}}, |
| 129 | {"\x80", []interface{}{b80}}, |
| 130 | {"\x80\x80", []interface{}{b80, b80}}, |
| 131 | } |
| 132 | for _, tt := range tests { |
| 133 | got := mixedArrayFromString(tt.in) |
| 134 | if !reflect.DeepEqual(got, tt.want) { |
| 135 | t.Errorf("mixedArrayFromString(%q) = %#v; want %#v", tt.in, got, tt.want) |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | type mixPartsTest struct { |
| 141 | json, expected string |
nothing calls this directly
no test coverage detected