-
Notifications
You must be signed in to change notification settings - Fork 40
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
Location list cannot be used/tested after caught error #199
Comments
Likely related to Vader using a location list itself for errors? Try |
As near as I can tell, Vader itself does not write to the location list. (It does use the quickfix list.) However, following your suggestion, and after playing around with a ridiculous number of variations for the last couple days and using the process of elimination, I can now make a test case pass...but I don't understand why it passes and the whole thing feels incredibly fragile. Check out this crazy setuptest2.vim:
test2.vader:
I invoke this with:
And it passes:
Take away any of the secret ingredients and it fails:
This doesn't happen in plain Vimscripttest3.vim:
Reliably outputs:
You can add the I've not been able to replicate the Another weird thingI thought this was worth noting as well:
The above test will succeed every time in my copy of Vim 7.4.
Change the first
I would love to understand what is happening here. |
Maybe it helps to try my branch from #107 - might provide better error messages. |
@blueyed - Thanks, I'll try your branch and other versions of (Neo)vim. |
@blueyed I really like the improvements in your I also ran my tests on Neovim with identical results, so I feel pretty confident this is a Vader-specific problem. I might start combing through the Vader source to see if I can pinpoint exactly where everything goes wrong - somewhere between executing commands and opening tabs/windows? Any pointers on where to start looking would be appreciated. |
I've given up on this for now. I dived into it several times, but never learned anything satisfying. Thanks for your help @blueyed. I've opted to simply sidestep the problem by making my Vader tests independent. From this:
To this:
Which guarantees that no errors will be thrown in a Vim/Vader session before I get a chance to make assertions on the output of |
When any Vim error occurs during a Vader test (despite being caught by a
try/catch
block), any further attempts to read from the location list will fail.Example (
test.vader
):The first test will succeed (the location list returned by
getloclist(0)
contains the results of thelvimgrep
command.The second test intentionally fails to match and
lvimgrep
throws an error, which we catch.That's fine.
But thereafter, any subsequent attempts to perform an
lvimgrep
and inspect the location list will fail (getloclist(0)
returns an empty list).The Vader results:
What does work:
lvimgrep
manually and inspecting the location list with:echo getloclist(0)
lvimgrep
searches in Vader tests...until an error is thrownAny fix, work-around, or alternative way of testing
lvimgrep
results with Vader would be appreciated.The text was updated successfully, but these errors were encountered: