Skip to content

Commit 6becdf7

Browse files
committed
fix log path in tests
1 parent a383fe6 commit 6becdf7

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

lua/tests/go_hover_spec.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,45 +29,45 @@ describe('regex should work', function()
2929
local str = [[func Println(a ...any) (n int, err error)]]
3030
local ret = require('go.lsp').find_ret(str)
3131
print(vim.inspect(ret))
32-
eq({'n', 'err'}, ret)
32+
eq({ 'n', 'err' }, ret)
3333
end)
3434

3535
it('should find return', function()
3636
local str = [[func fmt.Println(a ...any) (int, error)]]
3737
local ret, e = require('go.lsp').find_ret(str)
3838
print(vim.inspect(ret))
39-
eq({'i', 'err'}, ret)
39+
eq({ 'i', 'err' }, ret)
4040
eq(true, e)
4141
end)
4242
it('should find return', function()
4343
local str = [[func fmt.Println(a, b int) (int, error)]]
4444
local ret, e = require('go.lsp').find_ret(str)
4545
print(vim.inspect(ret))
46-
eq({'i', 'err'}, ret)
46+
eq({ 'i', 'err' }, ret)
4747
eq(true, e)
4848
end)
4949

5050
it('should find return', function()
5151
local str = [[func fmt.Println(a, b int) int]]
5252
local ret, e = require('go.lsp').find_ret(str)
5353
print(vim.inspect(ret))
54-
eq({'i'}, ret)
54+
eq({ 'i' }, ret)
5555
eq(false, e)
5656
end)
5757

5858
it('should find return', function()
5959
local str = [[func fmt.Println(a, b int) MyType]]
6060
local ret, e = require('go.lsp').find_ret(str)
6161
print(vim.inspect(ret))
62-
eq({'myType'}, ret)
62+
eq({ 'myType' }, ret)
6363
eq(false, e)
6464
end)
6565

6666
it('should find return', function()
6767
local str = [[func fmt.Println(a, b int) (MyType, error)]]
6868
local ret, e = require('go.lsp').find_ret(str)
6969
print(vim.inspect(ret))
70-
eq({'myType', 'err'}, ret)
70+
eq({ 'myType', 'err' }, ret)
7171
eq(true, e)
7272
end)
7373
end)
@@ -86,6 +86,5 @@ describe('should run hover', function()
8686

8787
local ret = require('go.lsp').gen_return(result)
8888
print(vim.inspect(ret))
89-
9089
end)
9190
end)

lua/tests/go_make_spec.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ describe('should run func make', function()
1616
require('go').setup({
1717
trace = true,
1818
lsp_cfg = true,
19-
log_path = vim.fn.expand('$HOME') .. '/tmp/gonvim.log',
19+
log_path = vim.fn.expand('$HOME') .. '/.cache/nvim/gonvim.log',
2020
})
21-
vim.cmd("silent cd " .. path)
21+
vim.cmd('silent cd ' .. path)
2222
vim.cmd("silent exe 'e " .. fname .. "'")
2323
vim.fn.setpos('.', { 0, 5, 11, 0 })
2424
local cmd = require('go.asyncmake').make('go', 'vet', './coverage')
@@ -36,10 +36,10 @@ describe('should run func make', function()
3636
require('go').setup({
3737
trace = true,
3838
lsp_cfg = true,
39-
log_path = vim.fn.expand('$HOME') .. '/tmp/gonvim.log',
39+
log_path = vim.fn.expand('$HOME') .. '/.cache/nvim/gonvim.log',
4040
})
4141

42-
vim.cmd("silent cd " .. path)
42+
vim.cmd('silent cd ' .. path)
4343
vim.cmd("silent exe 'e " .. fname .. "'")
4444
vim.fn.setpos('.', { 0, 6, 11, 0 })
4545
local cmd = require('go.asyncmake').make('go', 'test', './coverage')

lua/tests/init.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ require('go').setup({
3838
gofmt = 'gofumpt',
3939
goimports = 'goimports',
4040
verbose = true,
41-
log_path = vim.fn.expand('$HOME') .. '/tmp/gonvim.log',
41+
log_path = vim.fn.expand('$HOME') .. '/.cache/nvim/gonvim.log',
4242
lsp_cfg = true,
4343
})
4444

@@ -49,8 +49,6 @@ require('nvim-treesitter').setup({
4949
install_dir = vim.fn.stdpath('data') .. '/site',
5050
})
5151

52-
require('nvim-treesitter').install({ 'go' }):wait(10000) -- wait max. 5 minutes
53-
5452
vim.api.nvim_create_autocmd('FileType', {
5553
pattern = { 'go' },
5654
callback = function()

lua/tests/minimal.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ vim.cmd([[
1212
runtime! plugin/guihua.lua
1313
]])
1414

15-
vim.opt.swapfile = false -- no swapfile
16-
vim.opt.backup = false -- no backup
15+
vim.opt.swapfile = false -- no swapfile
16+
vim.opt.backup = false -- no backup
1717
vim.opt.writebackup = false -- no writebackup
1818

1919
vim.cmd('filetype indent off')
@@ -29,15 +29,15 @@ require('go').setup({
2929
verbose = true,
3030
gofmt = 'gofumpt',
3131
goimports = 'goimports',
32-
log_path = vim.fn.expand('$HOME') .. '/tmp/gonvim.log',
32+
log_path = vim.fn.expand('$HOME') .. '/.cache/nvim/gonvim.log',
3333
lsp_cfg = true,
3434
})
3535
require('nvim-treesitter').setup({
3636
-- Directory to install parsers and queries to
3737
install_dir = vim.fn.stdpath('data') .. '/site',
3838
})
3939

40-
require('nvim-treesitter').install({ 'go' }):wait(20000)
40+
require('nvim-treesitter').install({ 'go' }):wait(60000)
4141
vim.api.nvim_create_autocmd('FileType', {
4242
pattern = { 'go' },
4343
callback = function()

0 commit comments

Comments
 (0)