1
1
mirror of https://github.com/wader/fq.git synced 2024-11-28 03:02:55 +03:00
fq/internal/columnwriter/columnwriter_test.go
2021-09-12 13:08:50 +02:00

34 lines
655 B
Go

package columnwriter_test
import (
"fmt"
"os"
"testing"
"github.com/wader/fq/internal/columnwriter"
)
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()
}