tests updates

pull/163/head
ray-x 2 years ago
parent 7102361efd
commit c588f2bf4a

@ -30,6 +30,13 @@ local gen_comment = function(row, col)
comments = "// " .. ns.name .. " " .. ns.type
return comments, ns
end
ns = require("go.ts.go").get_type_node_at_pos(row, col)
if ns ~= nil and ns ~= {} then
-- utils.log("parnode" .. vim.inspect(ns))
comments = "// " .. ns.name .. " " .. ns.type
return comments, ns
end
return ""
end

@ -20,14 +20,14 @@ describe("should get nodes ", function()
local bufn = vim.fn.bufnr("")
it("should get struct playlist and generate comments", function()
vim.fn.setpos(".", {bufn, 20, 14, 0})
vim.fn.setpos(".", { bufn, 20, 14, 0 })
local query = require("go.comment").gen(20, 14)
eq("// createPlaylist function  ", query)
end)
it("should get struct playlist and generate comments", function()
vim.fn.setpos(".", {bufn, 14, 4, 0})
vim.fn.setpos(".", { bufn, 14, 4, 0 })
local query = require("go.comment").gen(14, 4)
eq("// playlist struct", query)
eq("// playlist type", query)
end)
end)

@ -161,7 +161,7 @@ describe("should run test file with flags inside file", function()
-- vim.fn.readfile('minimal.vim')
-- vim.fn.writefile(vim.fn.readfile('fixtures/fmt/hello.go'), name)
local status = require("plenary.reload").reload_module("go.nvim")
it("should test function", function()
it("should test function with tag", function()
--
-- go.nvim may not auto loaded
vim.cmd([[packadd go.nvim]])

Loading…
Cancel
Save