INNER CODE UNIT · Go
sessions
xo/usql · cli_test.go:85
func sessions() []capture.Session {
// memory is an in-memory SQLite database, so nothing is written to disk
// and each session starts from the same empty state.
const memory = "sqlite3://:memory:"
// noPager keeps the output in the terminal. Without it usql hands long
// output to a pager and the recording captures the pager instead.
noPager := []string{"--pset=pager=off"}
args := func(extra ...string) []string {
return append(append([]string{}, noPager...), extra...)
}
return []capture.Session{
{
Name: "banner-and-quit",
About: "usql prints its banner and a prompt, and \\q leaves",
Args: args(memory),
Steps: []capture.Step{
{Send: `\q` + capture.KeyEnter},
},