| 259 | } |
| 260 | |
| 261 | func captureTerminalOutputComplex(t testing.TB, captureConfig TmuxCaptureConfig) string { |
| 262 | require.NotNil(t, captureConfig.tester) |
| 263 | fullCommand := "" |
| 264 | fullCommand += buildTmuxInputCommands(t, captureConfig) |
| 265 | fullCommand += " tmux capture-pane -t foo -p" |
| 266 | if captureConfig.includeEscapeSequences { |
| 267 | // -e ensures that tmux runs the command in an environment that supports escape sequences. Used for rendering colors in the TUI. |
| 268 | fullCommand += "e" |
| 269 | } |
| 270 | fullCommand += "\n" |
| 271 | fullCommand += " tmux kill-session -t foo\n" |
| 272 | testutils.TestLog(t, "Running tmux command: "+fullCommand) |
| 273 | return strings.TrimSpace(captureConfig.tester.RunInteractiveShell(t, fullCommand)) |
| 274 | } |
| 275 | |
| 276 | func assertNoLeakedConnections(t testing.TB) { |
| 277 | resp, err := lib.ApiGet(makeTestOnlyContextWithFakeConfig(), "/api/v1/get-num-connections") |