Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage: allow to run coverage on _test.go files in subdirs #1033

Merged
merged 1 commit into from
Nov 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion autoload/go/coverage.vim
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function! go#coverage#overlay(file)
let cnt += 1
endwhile

let fname = expand('%:t')
let fname = expand('%')

" when called for a _test.go file, run the coverage for the actuall file
" file
Expand All @@ -221,6 +221,9 @@ function! go#coverage#overlay(file)
exe ":edit ". fnamemodify(fname, ":p")
endif

" cov.file includes only the filename itself, without full path
let fname = fnamemodify(fname, ":t")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here why you take the trail of the file (for example because of cov.file ...)


for line in lines[1:]
let cov = go#coverage#parsegocoverline(line)

Expand Down