Skip to content

Commit

Permalink
fix(core): fixes incorrect class name equality checks (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejecook authored May 24, 2022
1 parent 2384504 commit 4f2f018
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions framework/src/source/BaseTestSuite.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,10 +1134,10 @@ namespace rooibos
m.currentResult.fail(msg, m.currentAssertLineNumber)
return false
end if
className = Rooibos.Common.asString(value.__classname)
className = `${value.__classname}`
if className <> typeStr
if msg = ""
msg = "Expected class: " + typeStr + ", got " + className
msg = `Expected class: ${typeStr} got ${className}`
end if
m.currentResult.fail(msg, m.currentAssertLineNumber)
return false
Expand Down
6 changes: 5 additions & 1 deletion framework/src/source/CommonUtils.bs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ namespace rooibos.Common
' */
function asString(input, includeType = false) as string
if Rooibos.Common.isValid(input) = false
return "Invalid"
if includeType
return """" + input + """"
else
return input
end if
else if Rooibos.Common.isString(input)
return """" + input + """"
else if Rooibos.Common.isInteger(input) or Rooibos.Common.isLongInteger(input) or Rooibos.Common.isBoolean(input)
Expand Down

0 comments on commit 4f2f018

Please sign in to comment.