mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-26 18:23:27 +01:00
Add test for beta-mode enabling highlighting of matching queries
This commit is contained in:
parent
d2fec54ec0
commit
0627891be2
@ -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) {
|
||||
|
27
client/lib/goldens/TestTui-ColoredOutputWithSearch-BetaMode
Normal file
27
client/lib/goldens/TestTui-ColoredOutputWithSearch-BetaMode
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: > ech[7m [0m[39m[49m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│
|
||||
│────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│[93m[104m localhost [39m [93m/tmp/ [39m [93mOct 17 2022 21:43:21 PDT [39m [93m3s [39m [93m2 [39m [1m[93mech[0m[93m[104mo 'aaaaaa bbbb' [39m [90m[49m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
│[39m [90m│
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
hiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp
|
Loading…
Reference in New Issue
Block a user