mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-23 20:46:30 +02:00
Add control-d as an alternate key binding to close the TUI to fix #61 (plus some tests)
This commit is contained in:
@@ -1884,6 +1884,18 @@ func TestTui(t *testing.T) {
|
||||
})
|
||||
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
||||
compareGoldens(t, out, "TestTui-LeftScroll")
|
||||
|
||||
// Check that we can exit the TUI via pressing esc
|
||||
out = captureTerminalOutput(t, tester, []string{
|
||||
"hishtory SPACE tquery ENTER",
|
||||
"Escape",
|
||||
})
|
||||
if strings.Contains(out, "Search Query:") {
|
||||
t.Fatalf("unexpected out=\n%s", out)
|
||||
}
|
||||
if !testutils.IsGithubAction() {
|
||||
compareGoldens(t, out, "TestTui-Exit")
|
||||
}
|
||||
}
|
||||
|
||||
func captureTerminalOutput(t *testing.T, tester shellTester, commands []string) string {
|
||||
|
Reference in New Issue
Block a user