Skip to content

Commit

Permalink
test spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Dec 1, 2024
1 parent ce623d6 commit 03d4a92
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lua/tests/go_test_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ describe('should run test file', function()
vim.fn.setpos('.', { 0, 5, 11, 0 })
local cmd = require('go.gotest').test_file()

if cmd[3] == './coverage' then
cmd[3] = 'coverage'
end
eq({
'go',
'test',
'./coverage',
'coverage',
'-test.run',
[['Test_branch|TestBranch|TestBranchSubTest']],
}, cmd)
Expand Down Expand Up @@ -212,11 +215,14 @@ describe('should run test file with flags', function()
vim.fn.setpos('.', { 0, 5, 11, 0 })
local cmd = require('go.gotest').test_file('-t', 'tag1')

if cmd[3] == './coverage' then
cmd[3] = 'coverage'
end
eq({
'go',
'test',
'-tags=tag1',
'./coverage',
'coverage',
'-test.run',
[['Test_branch|TestBranch|TestBranchSubTest']],
}, cmd)
Expand Down Expand Up @@ -313,11 +319,14 @@ describe('should run test file with flags inside file: ', function()
vim.fn.setpos('.', { 1, 1, 1, 0 })
local cmd = require('go.gotest').test_file('-t', 'tag1')

if cmd[3] == './coverage' then
cmd[3] = 'coverage'
end
eq({
'go',
'test',
'-tags=tag1,integration,unit',
'./coverage',
'coverage',
'-test.run',
"'TestTag'",
}, cmd)
Expand Down

0 comments on commit 03d4a92

Please sign in to comment.