Skip to content

Commit

Permalink
fix: importing neotest-plenary causing lua print() broken (#12)
Browse files Browse the repository at this point in the history
Upon require("neotest-plenary"), lua global `print()` (and hence all
lua-based I/O) gets broken. This is because the module "plenary.busted"
overrides and shadows global `print()` as a side-effect.

This is a regression since #10.

Solution: The module "plenary.busted" should never be imported.
  • Loading branch information
wookayin committed Sep 29, 2023
1 parent ffc33b0 commit dcaf5ed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lua/neotest-plenary/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ local Path = require("plenary.path")
local lib = require("neotest.lib")
local base = require("neotest-plenary.base")

-- the local path to the plenary.nvim plugin installed
---@type string
local plenary_dir = vim.fn.fnamemodify(
debug.getinfo(require("plenary.busted").run).source:match("@?(.*[/\\])"), ":p:h:h:h"
)

local config = {
min_init = nil,
}
Expand Down Expand Up @@ -113,6 +107,12 @@ function PlenaryNeotestAdapter.build_spec(args)
end
end

-- the local path to the plenary.nvim plugin installed
---@type string
local plenary_dir = vim.fn.fnamemodify(
debug.getinfo(require("plenary.path").__index).source:match("@?(.*[/\\])"), ":p:h:h:h"
)

local cwd = assert(vim.loop.cwd())
local command = vim.tbl_flatten({
vim.loop.exepath(),
Expand Down

0 comments on commit dcaf5ed

Please sign in to comment.