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

Multilines don't play nicely with vim-go #83

Closed
shmup opened this issue Sep 9, 2014 · 10 comments · Fixed by #364
Closed

Multilines don't play nicely with vim-go #83

shmup opened this issue Sep 9, 2014 · 10 comments · Fixed by #364
Labels
bug pkg-assert Change related to package testify/assert TB.Helper Related to hiding testify calls in stack using testing.TB.Helper

Comments

@shmup
Copy link

shmup commented Sep 9, 2014

I also opened the issue over there, but figured I'd additionally post here.

fatih/vim-go#168

I attached two screenshots. One shows how go test renders in a terminal, and the other when using :GoTest within vim. I'm using testify mostly for assert functionality.

I chatted with fatih a bit in #go-nuts, and it was said that vim-go has pretty basic support for multilines.

screenshot 2014-09-09 19 46 45
screenshot 2014-09-09 19 47 40

@tylerstillwater
Copy link
Contributor

Right. The same thing happens in Sublime Text. The reason is that testify uses \b and \r to overwrite the output of the testing framework since it prints out the wrong location. Testify replaces that with the correct location that it finds.

I am not sure what, if anything, can be done about this. Any thoughts?

@shmup
Copy link
Author

shmup commented Sep 10, 2014

fatih responded basically saying that I could add a command like :GoTestify which would parse the output. He raised a good point. Other testing suites may have other issues, and he doesn't want to spend time with all of them.

For now I'm just going to use a simple wrapper: https://gist.github.com/karlseguin/5128442 but eventually I'd like to get back to testify.

I'll admit I haven't given the solution much thought. Maybe this weekend.

@tylerstillwater
Copy link
Contributor

He says we need a testing compatible output. I agree with that. We will be addressing this in #84.

@yasker
Copy link

yasker commented Feb 13, 2015

Would there be a update for this issue in the near future? It becomes the major reason currently I am reluctant to use testify. I just tried it and hit by this issue immediately, have to switch back to standard framework...

@nmiyake
Copy link
Contributor

nmiyake commented Oct 29, 2016

This affects running tests directly in IntelliJ as well.

I believe this is a real issue with alignment -- it has to do with outputting tabs instead of aligning properly via spaces for output. The update to put "expected:" and "received:" on different lines helps somewhat, but the issue still exists:

From terminal:

image

Using IntelliJ runner:

image

I have code that I believe fixes this -- it works in the IntelliJ runner and terminal, maintains the same output, and I believe it is more functionally correct. Will open as a PR shortly.

nmiyake added a commit to nmiyake/testify that referenced this issue Oct 29, 2016
Previous implementation depended on tab alignment. This worked
when the output was not prepended with anything, but would break
if the output was prepended with further spaces (which can occur
in environments like IntelliJ test runners). This commit fixes it
so that the output is always aligned logically.

Fixes stretchr#83
nmiyake added a commit to nmiyake/testify that referenced this issue Oct 29, 2016
Previous implementation depended on tab alignment. This worked
when the output was not prepended with anything, but would break
if the output was prepended with further spaces (which can occur
in environments like IntelliJ test runners). This commit fixes it
so that the output is always aligned logically.

Fixes stretchr#83
nmiyake added a commit to nmiyake/testify that referenced this issue Oct 29, 2016
Previous implementation depended on tab alignment. This worked
when the output was not prepended with anything, but would break
if the output was prepended with further spaces (which can occur
in environments like IntelliJ test runners). This commit fixes it
so that the output is always aligned logically.

Fixes stretchr#83
nmiyake added a commit to nmiyake/testify that referenced this issue Oct 29, 2016
Previous implementation depended on tab alignment. This worked
when the output was not prepended with anything, but would break
if the output was prepended with further spaces (which can occur
in environments like IntelliJ test runners). This commit fixes it
so that the output is always aligned logically.

Fixes stretchr#83
nmiyake added a commit to nmiyake/testify that referenced this issue Oct 29, 2016
Previous implementation depended on tab alignment. This worked
when the output was not prepended with anything, but would break
if the output was prepended with further spaces (which can occur
in environments like IntelliJ test runners). This commit fixes it
so that the output is always aligned logically.

Fixes stretchr#83
@rantav
Copy link

rantav commented Dec 13, 2016

I have this issue as well (using vim-go), is there a fix for that?

@nmiyake
Copy link
Contributor

nmiyake commented Dec 13, 2016

@rantav can you check out my branch with the fix (https://github.com/nmiyake/testify/tree/fixFailOutput, which is the basis for the PR #364) and see if that resolves the issue? I can try to set up vim-go and see if I can repro the issue and if my fix addresses it.

I opened the potential fix PR in late October but unfortunately have not received any feedback on it yet.

@rantav
Copy link

rantav commented Dec 18, 2016

Thanks @nmiyake but unfortunately for vim-go that still doesn't seem to work...

jonnyreeves pushed a commit to jonnyreeves/testify that referenced this issue Jan 5, 2017
Previous implementation depended on tab alignment. This worked
when the output was not prepended with anything, but would break
if the output was prepended with further spaces (which can occur
in environments like IntelliJ test runners). This commit fixes it
so that the output is always aligned logically.

Fixes stretchr#83
@sashaweiss
Copy link

Hey all - was there resolution on this, or a lasting workaround? Running into this myself currently, and it's driving me nuts.

@davidbanham
Copy link

@sashaweiss Yep, was fixed here:

a726187

@dolmen dolmen added bug pkg-assert Change related to package testify/assert TB.Helper Related to hiding testify calls in stack using testing.TB.Helper labels Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pkg-assert Change related to package testify/assert TB.Helper Related to hiding testify calls in stack using testing.TB.Helper
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants