lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 5 Apr 2014, at 12:32, <tonyp@acm.org> wrote:

> I think a better solution is needed.

(This is 5.2, don't know 5.1 situation)

If some code is called through require, then the chunk has the name given to require as it's first argument, if executed, there are no arguments to the chunk.

So, for testing, I do

local requirename = …
if requirename then
	return moduletable
end

--tests go here
	 
Thanks,
Kev