INNER CODE UNIT · Go
splitLines
xo/usql · cli_test.go:248
func splitLines(s string) []string {
var out []string
start := 0
for i := 0; i < len(s); i++ {
if s[i] == '\n' {
out = append(out, s[start:i])
start = i + 1
}
}
return append(out, s[start:])
}
// TestCLIRecordsSomething checks that the harness itself works, so that an
// empty recording cannot pass every golden comparison quietly.
func TestCLIRecordsSomething(t *testing.T) {
if runtime.GOOS != "linux" && runtime.GOOS != "darwin" {
t.Skipf("recording a terminal session needs a pseudo-terminal, which %s does not provide", runtime.GOOS)
}