summaryrefslogtreecommitdiff
path: root/tests/helpers.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-03-24 16:16:38 +0100
committerGitHub <[email protected]>2022-03-24 16:16:38 +0100
commit08d3df2cd3515878309906c2791d1b934425d78f (patch)
tree1fa487649e33329add38c5c3a8abb12acdfd41d2 /tests/helpers.lua
parent1ea836e3601b7ed0ed0496888dc14683bfbcce75 (diff)
feat(plugins): add support for packer snapshots (#2351)
Diffstat (limited to 'tests/helpers.lua')
-rw-r--r--tests/helpers.lua51
1 files changed, 0 insertions, 51 deletions
diff --git a/tests/helpers.lua b/tests/helpers.lua
deleted file mode 100644
index ada83267..00000000
--- a/tests/helpers.lua
+++ /dev/null
@@ -1,51 +0,0 @@
-local M = {}
-
-function M.search_file(file, args)
- local Job = require "plenary.job"
- local stderr = {}
- local stdout, ret = Job
- :new({
- command = "grep",
- args = { args, file },
- cwd = get_cache_dir(),
- on_stderr = function(_, data)
- table.insert(stderr, data)
- end,
- })
- :sync()
- return stdout, ret, stderr
-end
-
-function M.file_contains(file, query)
- local stdout, ret, stderr = M.search_file(file, query)
- if ret == 0 then
- return true
- end
- if not vim.tbl_isempty(stderr) then
- error(vim.inspect(stderr))
- end
- if not vim.tbl_isempty(stdout) then
- error(vim.inspect(stdout))
- end
- return false
-end
-
-function M.log_contains(query)
- local logfile = require("lvim.core.log"):get_path()
- local stdout, ret, stderr = M.search_file(logfile, query)
- if ret == 0 then
- return true
- end
- if not vim.tbl_isempty(stderr) then
- error(vim.inspect(stderr))
- end
- if not vim.tbl_isempty(stdout) then
- error(vim.inspect(stdout))
- end
- if not vim.tbl_isempty(stderr) then
- error(vim.inspect(stderr))
- end
- return false
-end
-
-return M