luassert icon indicating copy to clipboard operation
luassert copied to clipboard

assertion.returned_arguments.x appear to have the wrong assert failure message

Open matthiesenj opened this issue 1 year ago • 1 comments

The english localization (in en.lua) seems to have the wrong assertion messages. They mention arguments the function is called with, but the keys indicate, they refer to the number of values returned by said function.

s:set("assertion.returned_arguments.positive", "Expected to be called with %s argument(s), but was called with %s")
s:set("assertion.returned_arguments.negative", "Expected not to be called with %s argument(s), but was called with %s")

This is further backed up by the example on the front page which uses the assertion.returned_arguments together with a custom message that mentions return arguments:

assert.message("the function 'f' did not return 2 arguments").returned_arguments(2, f())

I haven't checked if other localizations are affected, too.

matthiesenj avatar Jun 06 '24 10:06 matthiesenj

Contributions are welcome, I'll help facilitate any PRs that address this.

alerque avatar Jun 06 '24 13:06 alerque