Strengthen /fs/browse test: assert dir and entry paths

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 20:16:36 -04:00
parent a108964457
commit acf336c846
+10 -3
View File
@@ -148,17 +148,24 @@ func TestBrowseListsDirsAndMarkdown(t *testing.T) {
if resp.Parent != filepath.Dir(dir) {
t.Errorf("parent = %q, want %q", resp.Parent, filepath.Dir(dir))
}
var names []string
for _, e := range resp.Entries {
names = append(names, e.Name)
if resp.Dir != dir {
t.Errorf("dir = %q, want %q", resp.Dir, dir)
}
var names []string
hasSub, hasMd, hasTxt := false, false, false
for _, e := range resp.Entries {
names = append(names, e.Name)
switch e.Name {
case "sub":
hasSub = e.IsDir
if e.Path != filepath.Join(dir, e.Name) {
t.Errorf("sub path = %q, want %q", e.Path, filepath.Join(dir, e.Name))
}
case "profile.md":
hasMd = !e.IsDir
if e.Path != filepath.Join(dir, e.Name) {
t.Errorf("profile.md path = %q, want %q", e.Path, filepath.Join(dir, e.Name))
}
case "notes.txt":
hasTxt = true
}