Fix AI test by quoting the sent keys to ensure zsh doesn't complain about the question mark

This commit is contained in:
David Dworken 2023-11-11 22:07:59 -08:00
parent a184bd4243
commit 3df099c945
2 changed files with 3 additions and 3 deletions

View File

@ -1946,7 +1946,7 @@ func testTui_ai(t *testing.T) {
// Test running an AI query
out := captureTerminalOutput(t, tester, []string{
"hishtory SPACE tquery ENTER",
"myQuery",
"?myQuery",
})
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
testutils.CompareGoldens(t, out, "TestTui-AiQuery")

View File

@ -240,9 +240,9 @@ func captureTerminalOutputComplex(t testing.TB, captureConfig TmuxCaptureConfig)
require.NotEmpty(t, captureConfig.complexCommands)
for _, cmd := range captureConfig.complexCommands {
if cmd.Keys != "" {
fullCommand += " tmux send -t foo -- "
fullCommand += " tmux send -t foo -- '"
fullCommand += cmd.Keys
fullCommand += "\n"
fullCommand += "'\n"
}
if cmd.ResizeX != 0 && cmd.ResizeY != 0 {
fullCommand += fmt.Sprintf(" tmux resize-window -t foo -x %d -y %d\n", cmd.ResizeX, cmd.ResizeY)