Skip to content

Commit

Permalink
Added actual and expected to assertTrue and assertFalse
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdp committed Jan 6, 2025
1 parent c74252b commit 6419e5d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions framework/src/source/BaseTestSuite.bs
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,14 @@ namespace rooibos
' * @param {Dynamic} [msg=""] - message to display in the test report
' * @returns {boolean} - true if the assert was satisfied, false otherwise
' */
function fail(msg = "Error" as string) as dynamic
function fail(msg = "Error" as string, actual = "" as string, expected = "" as string) as dynamic
if m.currentResult.isFail
if m.throwOnFailedAssertion
throw m.currentResult.getMessage()
end if
return false
end if
m.currentResult.fail(msg, m.currentAssertLineNumber)
m.currentResult.fail(msg, m.currentAssertLineNumber, actual, expected)
return false
end function

Expand Down Expand Up @@ -361,10 +361,10 @@ namespace rooibos
try
if rooibos.common.isBoolean(expr)
if expr
return m.fail(msg)
return m.fail(msg, rooibos.common.asString(expr, true), rooibos.common.asString(false, true))
end if
else
return m.fail("value was not a boolean")
return m.fail("value was not a boolean", rooibos.common.asString(expr, true), rooibos.common.asString(false, true))
end if
return true
catch error
Expand All @@ -391,10 +391,10 @@ namespace rooibos
try
if rooibos.common.isBoolean(expr)
if not expr
return m.fail(msg)
return m.fail(msg, rooibos.common.asString(expr, true), rooibos.common.asString(true, true))
end if
else
return m.fail("value was not a boolean")
return m.fail("value was not a boolean", rooibos.common.asString(expr, true), rooibos.common.asString(true, true))
end if

return true
Expand Down

0 comments on commit 6419e5d

Please sign in to comment.