Eliud Egg problem

've created a solution for the Eliud egg problem in the lua track: Eliud's Eggs in Lua on Exercism.
Right now i don’t know if it’s correct mainly because one of the instruction says to print the result to the screen but this leads to the test not to run, and not printing the result leads to all tests failling. The code with no print is as it follows.

local PopCount = {}

function PopCount.egg_count(number)
local bin_eggs_position,eggs_arr,n_eggs = tostring(number),{},0

for i=1,#bin_eggs_position do
eggs_arr[i]=bin_eggs_position:sub(i,i)
end

for j=1,#eggs_arr do
if eggs_arr[j]==‘0’ then
n_eggs = n_eggs + 1
end
end

print(n_eggs)
end
return PopCount

Discussion happening in Discord.