public handler MCUnitOutputTest(in pCondition as Boolean, in pDescription as String, in pDirective as String, in pReason as String)
variable tMessage as String
if pCondition then
put "ok" into tMessage
else
put "not ok" into tMessage
end if
if pDescription is not empty then
put " - " & pDescription after tMessage
end if
if pDirective is not empty then
put " #" && pDirective after tMessage
if pReason is not empty then
put " " & pReason after tMessage
end if
end if
MCUnitOutput(tMessage)
end handler
foreign handler MCStringEncode(in Source as String, in Encoding as CInt, in IsExternalRep as CBool, out Encoded as Data) returns CBool binds to "<builtin>"
public handler MCUnitOutput(in pMessage as String)
variable tEncoded as Data
if the last char of pMessage is not "\n" then
put "\n" after pMessage
end if
-- Encode as UTF-8, always.
-- FIXME this should use LCB encoding library rather than directly