mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-18 02:40:33 +02:00
Add tablesizing command to get consistent table dimensions
This commit is contained in:
@@ -2387,6 +2387,9 @@ func TestSortByConsistentTimezone(t *testing.T) {
|
|||||||
defer testutils.BackupAndRestore(t)()
|
defer testutils.BackupAndRestore(t)()
|
||||||
installHishtory(t, tester, "")
|
installHishtory(t, tester, "")
|
||||||
|
|
||||||
|
// Add an entry just to ensure we get consistent table sizing
|
||||||
|
tester.RunInteractiveShell(t, "echo tablesizing")
|
||||||
|
|
||||||
// Add some entries with timestamps in different timezones
|
// Add some entries with timestamps in different timezones
|
||||||
db := hctx.GetDb(hctx.MakeContext())
|
db := hctx.GetDb(hctx.MakeContext())
|
||||||
timestamp := int64(1650096186)
|
timestamp := int64(1650096186)
|
||||||
@@ -2408,9 +2411,9 @@ func TestSortByConsistentTimezone(t *testing.T) {
|
|||||||
testutils.Check(t, lib.ReliableDbCreate(db, entry3))
|
testutils.Check(t, lib.ReliableDbCreate(db, entry3))
|
||||||
|
|
||||||
// And check that they're displayed in the correct order
|
// And check that they're displayed in the correct order
|
||||||
out := hishtoryQuery(t, tester, "-pipefail")
|
out := hishtoryQuery(t, tester, "-pipefail -tablesizing")
|
||||||
testutils.CompareGoldens(t, out, "TestSortByConsistentTimezone-query")
|
testutils.CompareGoldens(t, out, "TestSortByConsistentTimezone-query")
|
||||||
out = captureTerminalOutput(t, tester, []string{"hishtory SPACE tquery SPACE -pipefail ENTER"})
|
out = captureTerminalOutput(t, tester, []string{"hishtory SPACE tquery SPACE -pipefail SPACE -tablesizing ENTER"})
|
||||||
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
||||||
testutils.CompareGoldens(t, out, "TestSortByConsistentTimezone-tquery")
|
testutils.CompareGoldens(t, out, "TestSortByConsistentTimezone-tquery")
|
||||||
}
|
}
|
||||||
|
@@ -1,31 +1,31 @@
|
|||||||
-pipefail
|
-pipefail -tablesizing
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Search Query: > -pipefail
|
Search Query: > -pipefail -tablesizing
|
||||||
|
|
||||||
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
│ Hostname CWD Timestamp Runtime Exit Code Command │
|
│ Hostname CWD Timestamp Runtime Exit Code Command │
|
||||||
│──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||||
│ localhost /tmp/ Apr 16 2022 01:36:26 PDT 1s 2 third_entry │
|
│ localhost /tmp/ Apr 16 2022 01:36:26 PDT 1s 2 third_entry │
|
||||||
│ localhost /tmp/ Apr 16 2022 01:19:46 PDT 1s 2 second_entry │
|
│ localhost /tmp/ Apr 16 2022 01:19:46 PDT 1s 2 second_entry │
|
||||||
│ localhost /tmp/ Apr 16 2022 01:03:06 PDT 1s 2 first_entry │
|
│ localhost /tmp/ Apr 16 2022 01:03:06 PDT 1s 2 first_entry │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
│ │
|
│ │
|
||||||
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||||
hiSHtory: Search your shell history • ctrl+h help
|
hiSHtory: Search your shell history • ctrl+h help
|
Reference in New Issue
Block a user