mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-30 04:05:36 +01:00
control-r tests for fish with a search atom
This commit is contained in:
parent
1c561f5cc8
commit
dbccaebf85
@ -1748,7 +1748,6 @@ func captureTerminalOutputWithShellName(t *testing.T, tester shellTester, overri
|
|||||||
return strings.TrimSpace(tester.RunInteractiveShell(t, fullCommand))
|
return strings.TrimSpace(tester.RunInteractiveShell(t, fullCommand))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: the below, but for fish
|
|
||||||
func testControlR(t *testing.T, tester shellTester, shellName string) {
|
func testControlR(t *testing.T, tester shellTester, shellName string) {
|
||||||
// Setup
|
// Setup
|
||||||
defer shared.BackupAndRestore(t)()
|
defer shared.BackupAndRestore(t)()
|
||||||
@ -1831,12 +1830,9 @@ func testControlR(t *testing.T, tester shellTester, shellName string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Search using an atom
|
// Search using an atom
|
||||||
if shellName != "fish" {
|
out = captureTerminalOutputWithShellName(t, tester, shellName, []string{"C-R", "fo", "BSpace BSpace", "exit_code:2", "Enter"})
|
||||||
// TODO: why does this fail in fish???
|
if !strings.HasSuffix(out, " echo 'bar' &") {
|
||||||
out = captureTerminalOutputWithShellName(t, tester, shellName, []string{"C-R", "fo", "BSpace BSpace", "exit_code:127", "ENTER"})
|
t.Fatalf("hishtory tquery returned the wrong result, out=%#v", out)
|
||||||
if !strings.HasSuffix(out, " ls ~/") {
|
|
||||||
t.Fatalf("hishtory tquery returned the wrong result, out=%#v", out)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search and check that the table is updated
|
// Search and check that the table is updated
|
||||||
|
Loading…
Reference in New Issue
Block a user