Skip to content

Commit b1e414f

Browse files
committed
fixup
1 parent 01c2e72 commit b1e414f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

agent/ls.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func listFiles(query LSRequest) (LSResponse, error) {
9595
AbsolutePathString: absolutePathString,
9696
Contents: []LSFile{
9797
{
98-
Name: f.Name(),
98+
Name: filepath.Base(f.Name()),
9999
AbsolutePathString: absolutePathString,
100100
IsDir: false,
101101
},

agent/ls_internal_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,16 @@ func TestListFilesNotADirectory(t *testing.T) {
6666
Path: pathToArray(rel),
6767
Relativity: LSRelativityHome,
6868
}
69-
_, err = listFiles(query)
70-
require.ErrorContains(t, err, "is not a directory")
69+
resp, err := listFiles(query)
70+
require.NoError(t, err)
71+
require.Equal(t, filePath, resp.AbsolutePathString)
72+
require.ElementsMatch(t, []LSFile{
73+
{
74+
Name: "file.txt",
75+
AbsolutePathString: filePath,
76+
IsDir: false,
77+
},
78+
}, resp.Contents)
7179
}
7280

7381
func TestListFilesSuccess(t *testing.T) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy