Can't run tests in repos that have Zig submodules.
My temporary fix
In neotest-zig/init.lua -> function M._build_spec_with_buildfile(args, build_file_path), right after declaration of build_file_dir_path variable:
if string.find(build_file_dir_path, "\n") then
local lines = {}
for s in build_file_dir_path:gmatch("[^\r\n]+") do
table.insert(lines, s)
break
end
build_file_dir_path = lines[1]
log.info("DEBUGGING new build_file_dir_path", build_file_dir_path)
end
It seems like the Lua pattern didn't account for submodules shenanigans. In my case, before the fix, build_file_dir_path was very messed up and had multiple \n characters in it, so I tried the fix and everything works as normal.
Steps To Reproduce
zig init
git init
mkdir submodules
git submodule add https://github.com/ziglibs/treez.git submodules/treez
main.zig
Current behavior
Can't run tests in repos that have Zig submodules.
My temporary fix
In
neotest-zig/init.lua
->function M._build_spec_with_buildfile(args, build_file_path)
, right after declaration ofbuild_file_dir_path
variable:It seems like the Lua pattern didn't account for submodules shenanigans. In my case, before the fix,
build_file_dir_path
was very messed up and had multiple\n
characters in it, so I tried the fix and everything works as normal.