lean2/tests/lua/num2.lua
Leonardo de Moura 7b8bd97699 feat(lua/expr): add method for extracting semantic attachment data
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-19 19:06:47 -08:00

10 lines
345 B
Lua

assert(nVal(10):data() == mpz(10))
assert(not pcall(function() nVal(-10) end))
assert(iVal(10):data() == mpz(10))
assert(iVal(-10):data() == mpz(-10))
assert(rVal(10):data() == mpq(10))
assert(rVal(10):data() ~= mpz(10))
assert(rVal("10/3"):data() == mpq(10)/3)
assert(rVal("-10/3"):data() == mpq(-10)/3)
assert(Const("a"):data() == name("a"))