lean2/tests/lua/old/ty2.lua
Leonardo de Moura a6116e3156 test(lua): reactivate some of the Lua unit tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-04-29 10:36:57 -07:00

12 lines
350 B
Lua

local env = environment()
local inferer = type_inferer(env)
env:add_var("N", Type())
local N = Const("N")
env:add_var("a", N)
local ctx = context()
ctx = extend(ctx, "x", N)
assert(inferer(Var(0), ctx) == N)
assert(not pcall(function() inferer(Var(1), ctx) end))
inferer:clear()
assert(inferer(Var(0), ctx) == N)
assert(is_type_inferer(inferer))