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

:GoTest replaces current buffer with blank #618

Closed
shazow opened this issue Nov 25, 2015 · 3 comments
Closed

:GoTest replaces current buffer with blank #618

shazow opened this issue Nov 25, 2015 · 3 comments
Labels

Comments

@shazow
Copy link
Contributor

shazow commented Nov 25, 2015

Running :GoTest on passing tests is fine. Running :GoTest on failing tests with no logging/output is fine. Running :GoTest with a test that hits code which logs or produces output and fails the test will cause vim-go to replace the current buffer with a blank buffer.

The command status line has this in it:

"2015/11/25 13" [New file] --No lines in buffer--vim-go: [test] FAIL

Minimal code to reproduce:

main_test.go

package main

import (
    "log"
    "testing"
)

func Foo() {
    log.Printf("Foo: Computing the answer.")
}

func TestFoo(t *testing.T) {
    Foo()
    t.Fail() // This prompts `go test` to present the captured output which presumably spawns the empty buffer somehow
}

You can split it up into main.go/main_test.go if you prefer.

@fatih
Copy link
Owner

fatih commented Nov 25, 2015

We have a fix for :GoRun which filters out these kind of problems. We need to do the same thing for this. Thanks for adding a test code, this will simplify and make it easier for me :)

@fatih fatih added the bug label Nov 25, 2015
@shazow
Copy link
Contributor Author

shazow commented Nov 25, 2015

My pleasure, thanks for being the ✨ Bug-fixing Fairy ✨

:D

@fatih
Copy link
Owner

fatih commented Dec 2, 2015

@shazow this is fixed with 61c9b49

It'll be in master once I've merged the neovim integration. It was handy, and the brances master and nvim are really different, I didn't want to cherry pick and and merge them forth and back. So it'll probably be in master in ~1 week.

@fatih fatih closed this as completed in 61c9b49 Dec 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants