github action & unit test updates

pull/298/head
ray-x 1 year ago
parent 2ed66cb302
commit 290ecba852

@ -58,7 +58,18 @@ describe('should run func test', function()
vim.fn.setpos('.', { 0, 5, 11, 0 }) vim.fn.setpos('.', { 0, 5, 11, 0 })
local cmd = require('go.gotest').test_func('-a', 'mock=true') local cmd = require('go.gotest').test_func('-a', 'mock=true')
eq({ 'go', 'test', '-run', [['^Test_branch$']], './lua/tests/fixtures/coverage', '-args', 'mock=true' }, cmd) eq(
{
'go',
'test',
'-run',
[['^Test_branch$']],
'./lua/tests/fixtures/coverage',
'-args',
'mock=true',
},
cmd
)
end) end)
end) end)
@ -105,7 +116,17 @@ describe('should run test file with flags', function()
vim.fn.setpos('.', { 0, 5, 11, 0 }) vim.fn.setpos('.', { 0, 5, 11, 0 })
local cmd = require('go.gotest').test_file('-t', 'tag1') local cmd = require('go.gotest').test_file('-t', 'tag1')
eq({ 'go', 'test', '-tags=tag1', '-run', [['Test_branch|TestBranch']], 'lua/tests/fixtures/coverage' }, cmd) eq(
{
'go',
'test',
'-tags=tag1',
'-run',
[['Test_branch|TestBranch']],
'lua/tests/fixtures/coverage',
},
cmd
)
end) end)
end) end)
@ -150,7 +171,10 @@ describe('should run test ', function()
vim.fn.setpos('.', { 0, 6, 1, 0 }) vim.fn.setpos('.', { 0, 6, 1, 0 })
local cmd = require('go.gotest').test('-n', '-t', 'tags1') local cmd = require('go.gotest').test('-n', '-t', 'tags1')
eq({ 'go', 'test', '-tags=tags1', '-run', [['^Test_branch$']], './lua/tests/fixtures/coverage' }, cmd) eq(
{ 'go', 'test', '-tags=tags1', '-run', [['^Test_branch$']], './lua/tests/fixtures/coverage' },
cmd
)
end) end)
end) end)
@ -202,7 +226,7 @@ describe('should run test file with flags inside file', function()
'test', 'test',
'-tags=tag1,integration,unit', '-tags=tag1,integration,unit',
'-run', '-run',
'TestTag', [['TestTag']],
'lua/tests/fixtures/coverage', 'lua/tests/fixtures/coverage',
}, cmd) }, cmd)
end) end)

Loading…
Cancel
Save