INNER CODE UNIT · Go

TestCLIRecordsSomething

xo/usql · cli_test.go:262

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)
	}
	tr, err := capture.Record(context.Background(), usqlPath, capture.Session{
		Name:  "smoke",
		Args:  []string{"--pset=pager=off", "sqlite3://:memory:"},
		Steps: []capture.Step{{Send: `\q` + capture.KeyEnter, Wait: 2 * time.Second}},
	})
	if err != nil {
		t.Fatalf("recording: %v", err)
	}
	if len(tr.Bytes()) == 0 {
		t.Fatal("the recording is empty, so every golden comparison would be meaningless")
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…