Solution to handle current math.ln/math.log builtin workaround causing
failed tests.
The current code injects "math.ln = math.log; " at the beginning of
emitted Lua, but this broke the assert_translation for the run-tests. So
this solution updates assert_translation to be aware of this injection.
@@ -35,6 +35,10 @@ end)
local function assert_translation(pallene_code, expected)
assert(compile("__translation_test__.pln", pallene_code))
local contents = assert(util.get_file_contents("__translation_test__.lua"))
+ -- The introduction of math.ln in Pallene to workaround single param math.log requires emitted
+ -- Lua code to handle this as well. The current workaround injects "math.ln = math.log; " at
+ -- the beginning of the emited Lua. This function needs to account for this injection.
+ expected = "math.ln = math.log; " .. expected
assert.are.same(expected, contents)
end
