mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-18 10:49:54 +02:00
Fix bug where typing 'foo:' and then hitting backspace would lead to the error still being displayed
This commit is contained in:
@@ -1839,7 +1839,7 @@ func TestTui(t *testing.T) {
|
||||
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
||||
testutils.CompareGoldens(t, out, "TestTui-InitialInvalidSearch")
|
||||
|
||||
// Check the output when the initial search is invalid
|
||||
// Check the output when the search is invalid
|
||||
out = captureTerminalOutput(t, tester, []string{
|
||||
"hishtory SPACE tquery ENTER",
|
||||
"ls:",
|
||||
@@ -1847,6 +1847,14 @@ func TestTui(t *testing.T) {
|
||||
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
||||
testutils.CompareGoldens(t, out, "TestTui-InvalidSearch")
|
||||
|
||||
// Check the output when the search is invalid and then edited to become valid
|
||||
out = captureTerminalOutput(t, tester, []string{
|
||||
"hishtory SPACE tquery ENTER",
|
||||
"ls: BSpace",
|
||||
})
|
||||
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
||||
testutils.CompareGoldens(t, out, "TestTui-InvalidSearchBecomesValid")
|
||||
|
||||
// Check the output when the size is smaller
|
||||
out = captureTerminalOutputWithShellNameAndDimensions(t, tester, tester.ShellName(), 100, 20, []TmuxCommand{
|
||||
{Keys: "hishtory SPACE tquery ENTER"},
|
||||
|
Reference in New Issue
Block a user