Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve base comparator method #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions UnitTestFramework.brs
Original file line number Diff line number Diff line change
Expand Up @@ -2796,18 +2796,21 @@ end function

' @return True if values are equal or False in other case.
function TF_Utils__BaseComparator(value1 as Dynamic, value2 as Dynamic) as Boolean
value1Type = Type(value1)
value2Type = Type(value2)
if (Type(Box(value1), 3) <> Type(Box(value2), 3))
return false
end if

valuesType = Type(Box(value1), 3)

if (value1Type = "roList" or value1Type = "roArray") and (value2Type = "roList" or value2Type = "roArray")
if (valuesType = "roSGNode")
return value1.isSameNode(value2)
else if (valuesType = "roList" or valuesType = "roArray")
return TF_Utils__EqArray(value1, value2)
else if value1Type = "roAssociativeArray" and value2Type = "roAssociativeArray"
else if (valuesType = "roAssociativeArray")
return TF_Utils__EqAssocArray(value1, value2)
else if Type(box(value1), 3) = Type(box(value2), 3)
return value1 = value2
else
return false
end if

return value1 = value2
end function

' ----------------------------------------------------------------
Expand Down