(t *testing.T)
| 1393 | }} |
| 1394 | |
| 1395 | func TestEncodeElement(t *testing.T) { |
| 1396 | for idx, test := range encodeElementTests { |
| 1397 | var buf bytes.Buffer |
| 1398 | enc := NewEncoder(&buf) |
| 1399 | err := enc.EncodeElement(test.value, test.start) |
| 1400 | if err != nil { |
| 1401 | t.Fatalf("enc.EncodeElement: %v", err) |
| 1402 | } |
| 1403 | err = enc.Flush() |
| 1404 | if err != nil { |
| 1405 | t.Fatalf("enc.Flush: %v", err) |
| 1406 | } |
| 1407 | if got, want := buf.String(), test.expectXML; got != want { |
| 1408 | t.Errorf("#%d(%s): EncodeElement(%#v, %#v):\nhave %#q\nwant %#q", idx, test.desc, test.value, test.start, got, want) |
| 1409 | } |
| 1410 | } |
| 1411 | } |
| 1412 | |
| 1413 | func BenchmarkMarshal(b *testing.B) { |
| 1414 | b.ReportAllocs() |
nothing calls this directly
no test coverage detected