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
Most expects do not check for self.inverse to see if the error should say it did 'not' match expected value. This causes confusing errors when using the ["not"] modifier.
Atm each matcher needs to manually check and format the error with something like .. (expect.inverse and " not" or "") ..
It would be nicer if (like expect:checkEquals) there is a expect:throwUnexpected. Or that the checkEquals would work more like a guardEquals like this:
localfunctiontoBe(expect, expected)
localactual=expect.actual-- Old:-- if not expect:checkEquals(actual, expected) then-- error("Expected " .. tostring(actual) .. (expect.inverse and " not " or "") .. " to be " .. tostring(expected))-- end-- New concept:expect:guardEquality(actual, expected, "to be")
returntrueend
The text was updated successfully, but these errors were encountered:
Most expects do not check for
self.inverse
to see if the error should say it did 'not' match expected value. This causes confusing errors when using the ["not"] modifier.Atm each matcher needs to manually check and format the error with something like
.. (expect.inverse and " not" or "") ..
It would be nicer if (like
expect:checkEquals
) there is aexpect:throwUnexpected
. Or that the checkEquals would work more like aguardEquals
like this:The text was updated successfully, but these errors were encountered: