mirror of
https://github.com/ddworken/hishtory.git
synced 2024-12-24 15:58:52 +01:00
Re-order test to make debugging easier + flip inverted !=
This commit is contained in:
parent
8a9a901b70
commit
7199a36a71
@ -236,8 +236,13 @@ func testIntegrationWithNewDevice(t *testing.T, tester shellTester) {
|
||||
t.Fatalf("Failed to re-init with the user secret: %v", out)
|
||||
}
|
||||
|
||||
// Querying should show the history from the previous run
|
||||
// Querying shouldn't show the entry from the previous account
|
||||
out = hishtoryQuery(t, tester, "")
|
||||
if strings.Contains(out, "notinthehistory") {
|
||||
t.Fatalf("output contains the unexpected item: notinthehistory: \n%s", out)
|
||||
}
|
||||
|
||||
// And it should show the history from the previous run on this account
|
||||
expected = []string{"echo thisisrecorded", "echo mynewcommand", "hishtory enable", "echo bar", "echo foo", "ls /foo", "ls /bar", "ls /a"}
|
||||
for _, item := range expected {
|
||||
if !strings.Contains(out, item) {
|
||||
@ -247,10 +252,6 @@ func testIntegrationWithNewDevice(t *testing.T, tester shellTester) {
|
||||
t.Fatalf("output has %#v in it multiple times! out=%#v", item, out)
|
||||
}
|
||||
}
|
||||
// But not from the previous account
|
||||
if strings.Contains(out, "notinthehistory") {
|
||||
t.Fatalf("output contains the unexpected item: notinthehistory")
|
||||
}
|
||||
|
||||
tester.RunInteractiveShell(t, "echo mynewercommand")
|
||||
out = hishtoryQuery(t, tester, "")
|
||||
|
@ -69,7 +69,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
lib.CheckFatalError(lib.Setup(os.Args))
|
||||
if os.Getenv("HISHTORY_SKIP_INIT_IMPORT") != "" {
|
||||
if os.Getenv("HISHTORY_SKIP_INIT_IMPORT") == "" {
|
||||
fmt.Println("Importing existing shell history...")
|
||||
ctx := hctx.MakeContext()
|
||||
numImported, err := lib.ImportHistory(ctx, false)
|
||||
|
Loading…
Reference in New Issue
Block a user