Running PlenaryBustedDirectory with more than one option via the command interface
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- lua
- Domain
- cli, documentation, testing
Research direction
Start with the PlenaryBustedDirectory command interface and compare its argument handling with the directly invoked test_harness.test_directory API shown in the report. Reproduce the multi-option command, then determine whether the supported outcome should be corrected command parsing or documentation of the API workaround; the issue is done when the chosen behavior is verified and clearly documented.
Written by the indexing model from the issue text.
Description
The docs suggest that one can run a test suite through the PlenaryBustedDirectory command. This seems to take two arguments - the second one being a Lua table of options. I learned that you can only really provide one entry in this table, as doing anything else seem to induce ambiguous syntax and the argument gets translated to something completely else.
For example, the following:
$ nvim --headless -c "PlenaryBustedDirectory tests/plenary/ {minimal_init = '/foobar', sequential=true}"
will make the test harness receive it as:
local split_string = vim.split(command, " ")
local directory = table.remove(split_string, 1)
print(vim.inspect(split_string)) -- { "minimal_init='/foobar'\n.", "", "sequential=true" }
local opts = assert(loadstring("return " .. table.concat(split_string, " ")))()
return harness.test_directory(directory, opts)
I've not researched this much more than this, but it seems like the comma might be the culprit.
To resolve this, I bypassed the command interface and call the Lua API directly instead, like so:
$ nvim --headless -c "lua require('plenary.test_harness').test_directory('.', {minimal_init='/foobar',sequential=true})"
I wonder if the docs should be updated to reflect this, and perhaps even deprecate this particular command interface?
- Dominant language
- Lua
- Stars
- 3.5k
- Forks
- 340
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nvim-lua/plenary.nvim
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
nvim-lua/plenary.nvim#682 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
nvim-lua/plenary.nvim#680 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
nvim-lua/plenary.nvim#675 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
nvim-lua/plenary.nvim#672 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
nvim-lua/plenary.nvim#671 · 1 comment ·
All issues in nvim-lua/plenary.nvim
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
[Eco] Egg Config Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
pterodactyl/game-eggs#634 ·
-
Feature Request
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Questie/QuestieTrace#33 ·