thinca / vim-themis

A testing framework for Vim script.
zlib License
238 stars 34 forks source link

Provide a message with expect #70

Closed flwyd closed 2 years ago

flwyd commented 2 years ago

Is your feature request related to a problem?

The error message for a failing expect call doesn't provide a lot of context about which line is failing. For example, # Expected 2 to equal '1' if there are several expect calls in the test, all of which involve numbers, or perhaps when checking a property of a list of items in a loop.

Describe the solution you'd like

I'd like to specify a message as part of the expect chain, much as one can be provided with assert calls. I can think of a couple ways this could be done:

thinca commented 2 years ago

expect-helper was added by @cohama. @cohama, what do you think?

FYI, helper functions from assert-helper can accept {message} argument.

cohama commented 2 years ago

I prefer 'chained function calls'.

I will try to implement it.