mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-16 10:31:11 +01:00
Add a test for custom columns for the classic non-TUI interface
This commit is contained in:
parent
7cfd03ccfe
commit
8b575e98c6
@ -1017,6 +1017,19 @@ func testDisplayTable(t *testing.T, tester shellTester) {
|
||||
manuallySubmitHistoryEntry(t, userSecret, entry3)
|
||||
out = hishtoryQuery(t, tester, "table")
|
||||
compareGoldens(t, out, "testDisplayTable-customColumns-multiLineCommand")
|
||||
|
||||
// Add a custom column
|
||||
tester.RunInteractiveShell(t, `hishtory config-add custom-columns foo "echo aaaaaaaaaaaaa"`)
|
||||
tester.RunInteractiveShell(t, ` hishtory enable`)
|
||||
tester.RunInteractiveShell(t, `echo table-1`)
|
||||
tester.RunInteractiveShell(t, `echo table-2`)
|
||||
tester.RunInteractiveShell(t, `echo bar`)
|
||||
tester.RunInteractiveShell(t, ` hishtory disable`)
|
||||
tester.RunInteractiveShell(t, `hishtory config-add displayed-columns foo`)
|
||||
|
||||
// And run a query and confirm it is displayed
|
||||
out = hishtoryQuery(t, tester, "table")
|
||||
compareGoldens(t, out, "testDisplayTable-customColumns-trulyCustom")
|
||||
}
|
||||
|
||||
func testRequestAndReceiveDbDump(t *testing.T, tester shellTester) {
|
||||
|
@ -0,0 +1,10 @@
|
||||
Hostname Exit Code Command CWD foo
|
||||
Davids-MacBook-Air.local 0 echo table-2 ~/code/hishtory aaaaaaaaaaaaa
|
||||
Davids-MacBook-Air.local 0 echo table-1 ~/code/hishtory aaaaaaaaaaaaa
|
||||
Davids-MacBook-Air.local 0 hishtory query table ~/code/hishtory
|
||||
localhost 2 while : /tmp/
|
||||
do
|
||||
ls /table/
|
||||
done
|
||||
localhost 3 table_cmd2 ~/foo/
|
||||
localhost 2 table_cmd1 /tmp/
|
Loading…
Reference in New Issue
Block a user