aboutsummaryrefslogtreecommitdiffstats
path: root/skate/zippy_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'skate/zippy_test.go')
-rw-r--r--skate/zippy_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/skate/zippy_test.go b/skate/zippy_test.go
index ed982b7..d0529c2 100644
--- a/skate/zippy_test.go
+++ b/skate/zippy_test.go
@@ -29,6 +29,37 @@ func TestLineColumn(t *testing.T) {
}
}
+func TestCutBatch(t *testing.T) {
+ var cases = []struct {
+ lines []string
+ column int
+ result []string
+ }{
+ {
+ []string{},
+ 1,
+ nil,
+ },
+ {
+ []string{},
+ 9,
+ nil,
+ },
+ {
+ []string{"1\t2\n", "3\t4\n"},
+ 2,
+ []string{"2", "4"},
+ },
+ }
+ for _, c := range cases {
+ result := CutBatch(c.lines, c.column)
+ if !reflect.DeepEqual(result, c.result) {
+ t.Fatalf("got %v (%d), want %v (%d)",
+ result, len(result), c.result, len(c.result))
+ }
+ }
+}
+
func TestUniqueMatches(t *testing.T) {
var cases = []struct {
about string