From 9204f3e71cf241247ec7c38fe95a155a42d59a7f Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sat, 29 Nov 2025 22:11:24 -0800 Subject: [PATCH] fix: remove test for deleted isPathWithinDir function --- cmd/bd/main_test.go | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/cmd/bd/main_test.go b/cmd/bd/main_test.go index c83a7207..d762fc13 100644 --- a/cmd/bd/main_test.go +++ b/cmd/bd/main_test.go @@ -152,51 +152,6 @@ func TestAutoFlushOnExit(t *testing.T) { } } -func TestIsPathWithinDir(t *testing.T) { - root := t.TempDir() - nested := filepath.Join(root, ".beads", "issues.jsonl") - sibling := filepath.Join(filepath.Dir(root), "other", "issues.jsonl") - traversal := filepath.Join(root, "..", "etc", "passwd") - tests := []struct { - name string - base string - candidate string - want bool - }{ - { - name: "same path", - base: root, - candidate: root, - want: true, - }, - { - name: "nested path", - base: root, - candidate: nested, - want: true, - }, - { - name: "sibling path", - base: root, - candidate: sibling, - want: false, - }, - { - name: "traversal outside base", - base: root, - candidate: traversal, - want: false, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := isPathWithinDir(tt.base, tt.candidate); got != tt.want { - t.Fatalf("isPathWithinDir(%q, %q) = %v, want %v", tt.base, tt.candidate, got, tt.want) - } - }) - } -} // TestAutoFlushConcurrency tests that concurrent operations don't cause races // TestAutoFlushStoreInactive tests that flush doesn't run when store is inactive