1
1
mirror of https://github.com/wader/fq.git synced 2024-12-01 02:30:32 +03:00
fq/internal/columnwriter/columnwriter_test.go

34 lines
655 B
Go
Raw Normal View History

2020-06-08 03:29:51 +03:00
package columnwriter_test
import (
"fmt"
"os"
"testing"
"github.com/wader/fq/internal/columnwriter"
2020-06-08 03:29:51 +03:00
)
func TestColumnWriter(t *testing.T) {
cw := columnwriter.New(os.Stdout, []int{3, 4})
fmt.Fprintln(cw.Columns[0], "aaaaa")
fmt.Fprintln(cw.Columns[0], "bb")
fmt.Fprint(cw.Columns[0], "cc")
fmt.Fprintln(cw.Columns[1], "11111")
fmt.Fprintln(cw.Columns[1], "22")
fmt.Fprintln(cw.Columns[1], "33")
cw.Flush()
fmt.Fprintln(cw.Columns[1], "aaaaa")
fmt.Fprintln(cw.Columns[1], "bb")
fmt.Fprint(cw.Columns[1], "cc")
fmt.Fprintln(cw.Columns[0], "11111")
fmt.Fprintln(cw.Columns[0], "22")
fmt.Fprintln(cw.Columns[0], "33")
cw.Flush()
}