package skate import "testing" func TestLineColumn(t *testing.T) { var cases = []struct { line string sep string column int result string }{ {"", "", 2, ""}, {"1 2 3", " ", 1, "1"}, {"1 2 3", " ", 2, "2"}, {"1 2 3", " ", 3, "3"}, {"1 2 3", " ", 4, ""}, {"1 2 3", "\t", 1, "1 2 3"}, } for _, c := range cases { result := CutSep(c.line, c.sep, c.column) if result != c.result { t.Fatalf("got %v, want %v", result, c.result) } } }