File: tabwriter_test.go

package info (click to toggle)
golang-github-juju-ansiterm 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: makefile: 9
file content (25 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package tabwriter

import (
	"bytes"
	"testing"

	gc "gopkg.in/check.v1"
)

func Test(t *testing.T) {
	gc.TestingT(t)
}

type tabwriterSuite struct{}

var _ = gc.Suite(&tabwriterSuite{})

func (s *tabwriterSuite) TestRightAlignOverflow(c *gc.C) {
	var buf bytes.Buffer
	tw := NewWriter(&buf, 0, 1, 2, ' ', 0)
	tw.SetColumnAlignRight(2)
	tw.Write([]byte("not\tenough\ttabs"))
	tw.Flush()
	c.Assert(buf.String(), gc.Equals, "not  enough  tabs")
}