(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestStringFromMixedArray(t *testing.T) { |
| 145 | tests := []mixPartsTest{ |
| 146 | {`["brad"]`, "brad"}, |
| 147 | {`["brad", 32, 70]`, "brad F"}, |
| 148 | {`["brad", "fitz"]`, "bradfitz"}, |
| 149 | {`["Am", 233, "lie.jpg"]`, "Am\xe9lie.jpg"}, |
| 150 | } |
| 151 | for idx, test := range tests { |
| 152 | var v []interface{} |
| 153 | if err := json.Unmarshal([]byte(test.json), &v); err != nil { |
| 154 | t.Fatalf("invalid JSON in test %d", idx) |
| 155 | } |
| 156 | got := stringFromMixedArray(v) |
| 157 | if got != test.expected { |
| 158 | t.Errorf("test %d got %q; expected %q", idx, got, test.expected) |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | func TestParseInLocation_UnknownLocation(t *testing.T) { |
| 164 | // Example of parsing a time from an API (e.g. Flickr) that |
nothing calls this directly
no test coverage detected