From 418f4ff3f98907e616656087c27015a0a9e41b9e Mon Sep 17 00:00:00 2001 From: David Dworken Date: Tue, 9 Jul 2024 18:46:22 -0700 Subject: [PATCH] Add integration test for #226 --- client/client_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/client_test.go b/client/client_test.go index 6f70861..6046781 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -822,6 +822,15 @@ echo other`) t.Fatalf("hishtory query has unexpected number of lines: out=%#v", out) } require.Contains(t, out, "/tmp") + + // Record a command in a directory that does not exist + tester.RunInteractiveShell(t, `mkdir /tmp/deleted-test +cd /tmp/deleted-test +rm -rf /tmp/deleted-test +echo test2 +`) + out = hishtoryQuery(t, tester, "echo test2") + require.Contains(t, out, "/tmp/deleted-test") } func testHishtoryBackgroundSaving(t *testing.T, tester shellTester) {