Add test for beta-mode enabling highlighting of matching queries

This commit is contained in:
David Dworken 2023-09-24 17:57:40 -07:00
parent d2fec54ec0
commit 0627891be2
No known key found for this signature in database
2 changed files with 34 additions and 0 deletions

View File

@ -1659,6 +1659,13 @@ func testTui_color(t testing.TB) {
out = captureTerminalOutputComplex(t, tester, tester.ShellName(), 200, 50, []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, true)
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch")
// And one more time with beta-mode for highlighting matches
tester.RunInteractiveShell(t, ` hishtory config-set beta-mode true`)
require.Equal(t, "true", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get beta-mode`)))
out = captureTerminalOutputComplex(t, tester, tester.ShellName(), 200, 50, []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, true)
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch-BetaMode")
}
func testTui_delete(t testing.TB) {

View File

@ -0,0 +1,27 @@
Search Query: > ech 
┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐
 Hostname CWD Timestamp Runtime Exit Code Command │
│────────────────────────────────────────────────────────────────────────────────────────────────────────│
 localhost  /tmp/  Oct 17 2022 21:43:21 PDT  3s  2  echo 'aaaaaa bbbb'  │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
 │
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘
hiSHtory: Search your shell history  • ctrl+h help