You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing a plugin which (usually) operates on empty buffers. Given blocks with some content to be placed in the buffer have a line entry in the optput window, as epxected, e.g. (1/2) [ GIVEN] A buffer with some content. However, if I have a Given block without any content in the buffer, then no output appears. Other behavior is still correct - the tests, (which mostly involve reading in text to the empty buffer) work correctly. But this breaks up the flow of reading the tests like a semi-sentence, which I believe is part of the design goal of frameworks such as this.
This is low priority, as it doesn't actually effect the testing regime. And being as we all seem to have a lot of free time these days, it's possible I'll submit a PR for this myself.
Minimal vader file for reproduction below.
# Buffer with content behaves as expected
Given (A buffer with some content):
Text
Do (Nothing):
Expect (No change):
Text
# Buffer with no content does not have messaging
Given (An empty buffer):
Do (Nothing):
Expect (No content):
Note that the last line has 2 spaces, telling the Expect block to look for a blank line.
The text was updated successfully, but these errors were encountered:
Possibly a solution would be to instead check if !empty(given) || !empty(comment.given)? Empty Given blocks are of course possible when they are omitted, but if there is an empty one with a comment it seems likely to be intentional by the test author.
I've not done tests in vader (very oroburos), but a quick proof of concept make it seems to me like that works. I'll put together a test file at some point, and submit my PR.
I'm testing a plugin which (usually) operates on empty buffers.
Given
blocks with some content to be placed in the buffer have a line entry in the optput window, as epxected, e.g.(1/2) [ GIVEN] A buffer with some content
. However, if I have aGiven
block without any content in the buffer, then no output appears. Other behavior is still correct - the tests, (which mostly involve reading in text to the empty buffer) work correctly. But this breaks up the flow of reading the tests like a semi-sentence, which I believe is part of the design goal of frameworks such as this.This is low priority, as it doesn't actually effect the testing regime. And being as we all seem to have a lot of free time these days, it's possible I'll submit a PR for this myself.
Minimal vader file for reproduction below.
Note that the last line has 2 spaces, telling the
Expect
block to look for a blank line.The text was updated successfully, but these errors were encountered: