Closed Lukc closed 5 years ago
After some quick testing, it's become obvious that in the test cases the print
function is not overridden, so instead of writing the result into the buffer it is just writing it to stdout. I have no idea right now why that could be, and trying it out in a separate file it actually works as it should. I will try to find the root of this problem within the coming days though.
After some hours of staring at the screen in bewilderment at why hates me so much, I've pinned the problem down to setfenv()
simply not doing what I want it to in line 59. It basically does nothing. The environment of the function does not change and the standard print
function is used instead.
After 3 more minutes of thinking I realized that I am simply stupid. For whatever reason I was completely convinced that in lua 5.1 I could set the current environment by assigning _G just like how I assign _ENV in 5.2+. Took me looking at the line for 2 seconds and I noticed how that makes no damn sense at all and that I need to use setfenv(1, <env>)
instead. It's fixed now (expect commit soon).
Okay, it should be fixed now
I’m using the rockspec provided by the repository and Lua 5.1, on Arch Linux.
Here’s the full output for further reference: