test(lua): add more s-exprs Lua tests

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-11-04 21:31:29 -08:00
parent 0ac8f2d8d9
commit 56344c0541

22
tests/lua/sexpr2.lua Normal file
View file

@ -0,0 +1,22 @@
s = sexpr(1, 2, 3)
print(s)
s = sexpr(1, 2, 3, nil)
print(s)
s = sexpr(sexpr(1, 2), sexpr(3, 4), nil)
print(s)
s = sexpr(mpz("100000000000000"), mpq(3)/2, sexpr(1, 2, 3, nil), nil)
print(s)
print(sexpr():is_nil())
print(sexpr(1):is_nil())
print(sexpr(true):is_bool())
print(sexpr(true):to_bool())
print(sexpr(false):to_bool())
print(sexpr(name("foo",1)):to_name())
print(sexpr(10):to_name())
print(sexpr(mpq(10)/3):to_mpq())
print(sexpr(mpz("10000000000000000000000000000000000")):to_mpz())
print(sexpr(10, 20, 30, 40, nil):length())
print(sexpr(10, 20, nil):head())
print(sexpr(10, 20, nil):tail())
print(sexpr(10, 20):head())
print(sexpr(10, 20):tail())