From bdc23fba3263afeba1c0563251d48a9c54ede7b9 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Mon, 11 Nov 2013 13:11:31 -0800 Subject: [PATCH] test(lua): add tests for expr object Signed-off-by: Leonardo de Moura --- tests/lua/expr5.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/lua/expr5.lua diff --git a/tests/lua/expr5.lua b/tests/lua/expr5.lua new file mode 100644 index 000000000..d52bb8536 --- /dev/null +++ b/tests/lua/expr5.lua @@ -0,0 +1,22 @@ +e = context_entry("a", Const("a")) +n = e:get_body() +check_error(function() mk_eq(n, Const("a")) end) +print(Const("a") < Const("b")) +check_error(function() mk_app(Const("a")) end) +print(mk_eq(Const("a"), Const("b"))) +print(mk_pi("x", Const("N"), Var(0))) +print(Pi("x", Const("N"), Const("x"))) +assert(mk_pi("x", Const("N"), Var(0)) == Pi("x", Const("N"), Const("x"))) +assert(mk_let("x", Const("a"), Var(0)) == Let("x", Const("a"), Const("x"))) +print(mk_let("x", Const("N"), Const("a"), Var(0))) +check_error(function() Pi({"x"}, Const("x")) end) +check_error(function() Pi({"x", Const("N")}, Const("x")) end) +check_error(function() Pi({{"x"}}, Const("x")) end) +check_error(function() Pi(Const("x")) end) +check_error(function() Pi(Const("x"), Const("N"), Const("x"), Const("a")) end) +check_error(function() Pi({}, Const("x")) end) + + + + +