lua-users home
lua-l archive

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


On 2014/7/31 9:47, Coda Highland wrote:
On Wed, Jul 30, 2014 at 6:44 PM, albert_200200 <albert_200200@126.com> wrote:
foo.lua
---------------------------------------
local M = {}
local function add_internal(a, b)
end

function M.add(a, b)
    add_internal(a, b)
end
return M


test.lua
---------------------------------------
require("foo.lua")
Is it possible in test.lua to test add_internal of foo.lua?

No. That's sort of the definition of "local".

/s/ Adam



Then the idiom of lunit is that "Don't test the private methods", right?