Skip to content

Commit 241b050

Browse files
committed
fixup
1 parent 14b0b61 commit 241b050

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)