Switching to use _1_as_lua()

This commit is contained in:
Bruce Hill 2019-01-23 15:43:06 -08:00
parent fb20a1f48a
commit e181c66ae4

View File

@ -23,8 +23,8 @@ use "core/control_flow"
do do
local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr) local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr)
if _a ~= _b then if _a ~= _b then
_a = type_of(_a) == 'Text' and _a:as_lua() or tostring(_a) _a = type_of(_a) == 'Text' and _a:as_lua() or _1_as_text(_a)
_b = type_of(_b) == 'Text' and _b:as_lua() or tostring(_b) _b = type_of(_b) == 'Text' and _b:as_lua() or _1_as_text(_b)
at_1_fail(\(quote "\($condition.1.source)"), at_1_fail(\(quote "\($condition.1.source)"),
"Assumption failed: This value was ".._a.." but it was expected to be ".._b..".") "Assumption failed: This value was ".._a.." but it was expected to be ".._b..".")
end end
@ -36,7 +36,7 @@ use "core/control_flow"
do do
local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr) local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr)
if _a == _b then if _a == _b then
_a = type_of(_a) == 'Text' and _a:as_lua() or tostring(_a) _a = type_of(_a) == 'Text' and _a:as_lua() or _1_as_text(_a)
at_1_fail(\(quote "\($condition.1.source)"), at_1_fail(\(quote "\($condition.1.source)"),
"Assumption failed: This value was ".._a.." but it wasn't expected to be.") "Assumption failed: This value was ".._a.." but it wasn't expected to be.")
end end
@ -48,8 +48,8 @@ use "core/control_flow"
do do
local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr) local _a, _b = \($condition.1 as lua expr), \($condition.3 as lua expr)
if _a ~= _b then if _a ~= _b then
_a = type_of(_a) == 'Text' and _a:as_lua() or tostring(_a) _a = type_of(_a) == 'Text' and _a:as_lua() or _1_as_text(_a)
_b = type_of(_b) == 'Text' and _b:as_lua() or tostring(_b) _b = type_of(_b) == 'Text' and _b:as_lua() or _1_as_text(_b)
at_1_fail(\(quote "\($condition.1.source)"), at_1_fail(\(quote "\($condition.1.source)"),
"Assumption failed: This value was ".._a..", but it was expected to be \($condition.3)".._b..".") "Assumption failed: This value was ".._a..", but it was expected to be \($condition.3)".._b..".")
end end