mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-09 15:15:08 +02:00
Clean up tests to make panics not happen for TUI test failures by moving repeated code line to a function at also adds a require
This commit is contained in:
@ -354,3 +354,8 @@ func stripShellPrefix(out string) string {
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func stripTuiCommandPrefix(t *testing.T, out string) string {
|
||||
require.Contains(t, out, "hishtory tquery")
|
||||
return strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
||||
}
|
||||
|
Reference in New Issue
Block a user