junegunn / junegunn/vader.vim

`Given` blocks which create an empty buffer do not get a line in the output window

Open
#207 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
599
Forks
40
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.