nvim-lua / plenary.nvim

plenary: full; complete; entire; absolute; unqualified. All the lua functions I don't want to write twice.
MIT License
2.79k stars 286 forks source link

PlenaryBustedDirectory not working on windows #255

Open qgymib opened 3 years ago

qgymib commented 3 years ago

This is beacuse currently plenary.test_harness use find to get all *_spec.lua, but windows builtin FIND is quite different from gnu find, which leads harness._find_files_to_run return an empty result.

function harness._find_files_to_run(directory)
  local finder = Job:new {
    command = "find",
    args = { directory, "-type", "f", "-name", "*_spec.lua" },
  }

  return vim.tbl_map(Path.new, finder:sync())
end

May be it is better to use plenary.scandir to do such a thing?

Conni2461 commented 3 years ago

Windows is currently not supported.

I tried to make it work, also with moving to scandir, but everytime i fixed an issue 10 more poped up. Maybe you wanna do it, i dont have a windows system so it was a nightmare to try to fix it.

Here is my work: https://github.com/nvim-lua/plenary.nvim/pull/74/files#diff-503c6d245571ab4d81c154079fb5736a3276b23ec1f97f09d826821f4c80168fR1

ckipp01 commented 2 years ago

Windows is currently not supported.

Just to clarify, is this still the case? If not, do you know of any examples out in the wild of running the plenary test harness on windows? Pretty much any issues I get reported that has to do with plenary is always regarding something to do with windows, so I'd love to be able to test for this. I also see that Plenary itself doesn't test on windows? Is that intentional because it's not supported, or an oversight, or something else?