// TestNewWriter tests that a new writer is created with the proper values.
TestNewWriter tests that a new writer is created with the proper values.
// TestNewWriter tests that a new writer is created with the proper values .
func TestNewWriter(t *testing.T) {
	w := NewWriter(&bytes.Buffer{}, 2)
	if _, ok := w.w.(*bytes.Buffer); !ok {
		t.Fatalf(`w.w is %T, want *bytes.Buffer`, w.w)
	}
	if l := len(w.bytes); l != 2 {
		t.Fatalf(`len(w.bytes) = %v, want 2`, l)
	}
	if w.index != 0 {
		t.Fatalf(`w.index = %v, want 0`, w.index)
	}
}
func TestNewWriter ( t * testing . T ) { w := NewWriter ( & bytes . Buffer { } , 2 ) if _ , ok := w . w . ( * bytes . Buffer ) ; ! ok { t . Fatalf ( `w.w is %T, want *bytes.Buffer` , w . w ) } if l := len ( w . bytes ) ; l != 2 { t . Fatalf ( `len(w.bytes) = %v, want 2` , l ) } if w . index != 0 { t . Fatalf ( `w.index = %v, want 0` , w . index ) } }
TestNewWriter tests that a new writer is created with the proper values.
TestNewWriter tests that a new writer is created with the proper values .