Files
linguist/samples/Terra/leaktest.t
2016-01-28 11:22:27 +07:00

27 lines
383 B
Perl

local leak = require "lib.leak"
function make()
local terra a(x:int)
return x+1
end
local terra b(x:int)
return a(x)
end
return b(12),leak.track(b)
end
nan = 0/0
res,t=make()
assert(res == 13)
local gcd, path = leak.find(t)
if gcd then
print(path)
assert(false)
end
l = leak.track(leak)
foo = 0/0
local f,p = leak.find(l)
assert(f)
assert(p == "$locals.leak")