(b *testing.B)
| 201 | } |
| 202 | |
| 203 | func BenchmarkParsingOfficialExamples(b *testing.B) { |
| 204 | file, _ := os.Open("structured-field-tests/examples.json") |
| 205 | dec := json.NewDecoder(file) |
| 206 | |
| 207 | var tests []test |
| 208 | _ = dec.Decode(&tests) |
| 209 | |
| 210 | for n := 0; n < b.N; n++ { |
| 211 | for _, te := range tests { |
| 212 | switch te.HeaderType { |
| 213 | case ITEM: |
| 214 | _, _ = UnmarshalItem(te.Raw) |
| 215 | case LIST: |
| 216 | _, _ = UnmarshalList(te.Raw) |
| 217 | case DICTIONARY: |
| 218 | _, _ = UnmarshalDictionary(te.Raw) |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | func BenchmarkSerializingOfficialExamples(b *testing.B) { |
| 225 | file, _ := os.Open("structured-field-tests/examples.json") |
nothing calls this directly
no test coverage detected
searching dependent graphs…