diff options
Diffstat (limited to 'src/pkg/encoding/xml/marshal_test.go')
| -rw-r--r-- | src/pkg/encoding/xml/marshal_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pkg/encoding/xml/marshal_test.go b/src/pkg/encoding/xml/marshal_test.go index 8d9239eb4a..31d4d4d853 100644 --- a/src/pkg/encoding/xml/marshal_test.go +++ b/src/pkg/encoding/xml/marshal_test.go @@ -1076,6 +1076,15 @@ func TestMarshalWriteIOErrors(t *testing.T) { } } +func TestEncodeTokenFlush(t *testing.T) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + enc.EncodeToken(StartElement{Name: Name{Local: "some-tag"}}) + if g, w := buf.String(), "<some-tag>"; g != w { + t.Errorf("Encoder wrote %q, want %q", g, w) + } +} + func BenchmarkMarshal(b *testing.B) { for i := 0; i < b.N; i++ { Marshal(atomValue) |
