Skip to content

Commit 253d348

Browse files
authored
fix: PlenaryBustedDirectory command (#455)
expand() should only be called for the first argument, not for the second one. The second argument is a string representation of a Lua option table which did work in case of a single entry, where only the braces were removed. For multiple entries Lua was not able to parse the expanded version as option table anymore, though.
1 parent 51351fd commit 253d348

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lua/plenary/test_harness.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ end
3131

3232
function harness.test_directory_command(command)
3333
local split_string = vim.split(command, " ")
34-
local directory = table.remove(split_string, 1)
34+
local directory = vim.fn.expand(table.remove(split_string, 1))
3535

3636
local opts = assert(loadstring("return " .. table.concat(split_string, " ")))()
3737

plugin/plenary.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ command! -nargs=1 -complete=file PlenaryBustedFile
44
\ lua require('plenary.busted').run(vim.fn.expand("<args>"))
55

66
command! -nargs=+ -complete=file PlenaryBustedDirectory
7-
\ lua require('plenary.test_harness').test_directory_command(vim.fn.expand("<args>"))
7+
\ lua require('plenary.test_harness').test_directory_command("<args>")
88

99
nnoremap <Plug>PlenaryTestFile :lua require('plenary.test_harness').test_directory(vim.fn.expand("%:p"))<CR>

0 commit comments

Comments
 (0)