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:
David Dworken
2023-11-12 00:40:24 -08:00
parent 3df099c945
commit c4b60eb6b2
2 changed files with 33 additions and 40 deletions

View File

@ -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])
}