-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
66 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package coverage | ||
|
||
// import "fmt" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package coverage | ||
|
||
import "testing" | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
//+build integration,unit | ||
|
||
package main | ||
package coverage | ||
|
||
func TestTag(t *testing.T) { | ||
t.Log("TestTag") | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module fixtures | ||
|
||
go 1.21.1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,49 @@ | ||
local eq = assert.are.same | ||
local cur_dir = vim.fn.expand("%:p:h") | ||
local busted = require("plenary/busted") | ||
local cur_dir = vim.fn.expand('%:p:h') | ||
local busted = require('plenary/busted') | ||
|
||
describe("should run func make", function() | ||
describe('should run func make', function() | ||
-- vim.fn.readfile('minimal.vim') | ||
-- vim.fn.writefile(vim.fn.readfile('fixtures/fmt/hello.go'), name) | ||
require("plenary.reload").reload_module("go.nvim") | ||
it("should make function", function() | ||
require('plenary.reload').reload_module('go.nvim') | ||
it('should make function', function() | ||
-- | ||
-- go.nvim may not auto loaded | ||
vim.cmd([[packadd go.nvim]]) | ||
|
||
local path = cur_dir .. "/lua/tests/fixtures/coverage/branch_test.go" -- %:p:h ? %:p | ||
require("go").setup({ | ||
local path = cur_dir .. '/lua/tests/fixtures/' | ||
local fname = 'coverage/branch_test.go' -- %:p:h ? %:p | ||
require('go').setup({ | ||
trace = true, | ||
lsp_cfg = true, | ||
log_path = vim.fn.expand("$HOME") .. "/tmp/gonvim.log", | ||
log_path = vim.fn.expand('$HOME') .. '/tmp/gonvim.log', | ||
}) | ||
vim.cmd("silent exe 'e " .. path .. "'") | ||
vim.fn.setpos(".", { 0, 5, 11, 0 }) | ||
local cmd = require("go.asyncmake").make('go', 'vet', '.') | ||
vim.cmd("silent cd " .. path) | ||
vim.cmd("silent exe 'e " .. fname .. "'") | ||
vim.fn.setpos('.', { 0, 5, 11, 0 }) | ||
local cmd = require('go.asyncmake').make('go', 'vet', './coverage') | ||
print(vim.inspect(cmd)) | ||
|
||
eq({ "go", "vet", "."}, cmd) | ||
eq({ 'go', 'vet', '.' }, cmd) | ||
end) | ||
it("should make function inside a source code", function() | ||
it('should make function inside a source code', function() | ||
-- | ||
-- go.nvim may not auto loaded | ||
vim.cmd([[packadd go.nvim]]) | ||
|
||
local path = cur_dir .. "/lua/tests/fixtures/coverage/branch.go" -- %:p:h ? %:p | ||
require("go").setup({ | ||
local path = cur_dir .. '/lua/tests/fixtures/' | ||
local fname = './coverage/branch.go' -- %:p:h ? %:p | ||
require('go').setup({ | ||
trace = true, | ||
lsp_cfg = true, | ||
log_path = vim.fn.expand("$HOME") .. "/tmp/gonvim.log", | ||
log_path = vim.fn.expand('$HOME') .. '/tmp/gonvim.log', | ||
}) | ||
vim.cmd("silent exe 'e " .. path .. "'") | ||
vim.fn.setpos(".", { 0, 6, 11, 0 }) | ||
local cmd = require("go.asyncmake").make('go', 'test', './...') | ||
|
||
eq({ "go", "test", "./..."}, cmd) | ||
vim.cmd("silent cd " .. path) | ||
vim.cmd("silent exe 'e " .. fname .. "'") | ||
vim.fn.setpos('.', { 0, 6, 11, 0 }) | ||
local cmd = require('go.asyncmake').make('go', 'test', './coverage') | ||
|
||
eq({ 'go', 'test', 'coverage' }, cmd) | ||
end) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters