From 32d54ef9a3e786b6dfb11994e53db5448e32f078 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 17 Jun 2014 22:17:06 -0700 Subject: [PATCH] fix(tests/lua): remove os.exit(0), it does not work if it is executed in the scope of a lock Signed-off-by: Leonardo de Moura --- tests/lua/scope.lua | 47 --------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/tests/lua/scope.lua b/tests/lua/scope.lua index 97bbddd884..f74553bdbd 100644 --- a/tests/lua/scope.lua +++ b/tests/lua/scope.lua @@ -72,50 +72,3 @@ for_each_coercion_user(env, function(C, D, f) print(tostring(C) .. " >-> " .. to assert(get_num_coercions(env) == 1) env = push_scope(env, "tst") assert(get_num_coercions(env) == 3) - - -os.exit(0) - - - - -print(get_coercion(env, nat, "mat")) -assert(env:type_check(get_coercion(env, nat, "mat"))) -env = add_coercion(env, "mat2dlst") -print("---------") -for_each_coercion_user(env, function(C, D, f) print(tostring(C) .. " >-> " .. tostring(D) .. " : " .. tostring(f)) end) -print(get_coercion(env, lst_nat, "dlst")) -assert(env:type_check(get_coercion(env, lst_nat, "dlst"))) - -env:export("coe1_mod.olean") -local env2 = import_modules("coe1_mod") -print(get_coercion(env2, lst_nat, "dlst")) -assert(env2:type_check(get_coercion(env2, lst_nat, "dlst"))) -assert(is_coercion(env2, "vec2mat")) -assert(is_coercion(env2, "lst2vec")) -env2 = add_decl(env2, mk_var_decl("lst2vec2", {l}, Pi({A, ll}, vec_l(A, len_l(A, ll))))) -print("======") -env2 = add_coercion(env2, "lst2vec2") -print("======") -print(get_coercion(env2, lst_nat, "dlst")) -print("---------") -for_each_coercion_user(env2, function(C, D, f) print(tostring(C) .. " >-> " .. tostring(D) .. " : " .. tostring(f)) end) -env2 = add_coercion(env2, "vec2lst") -env2 = add_decl(env2, mk_var_decl("lst2nat", {l}, Pi({A}, mk_arrow(lst_l(A), nat)))) -env2 = add_coercion(env2, "lst2nat") -print("---------") -for_each_coercion_user(env2, function(C, D, f) print(tostring(C) .. " >-> " .. tostring(D)) end) -for_each_coercion_user(env2, function(C, D, f) print(tostring(C) .. " >-> " .. tostring(D) .. " : " .. tostring(f)) end) - -assert(has_coercions_from(env2, lst_nat)) -assert(not has_coercions_from(env2, Const("foo"))) -assert(not has_coercions_from(env2, Const("lst", {1}))) -assert(has_coercions_from(env2, Const("vec", {1})(nat, one))) -assert(not has_coercions_from(env2, Const("vec", {1})(nat))) -assert(not has_coercions_from(env2, Const("vec")(nat, one))) - -print("Coercions (vec nat one): ") -cs = get_user_coercions(env2, Const("vec", {1})(nat, one)) -for i = 1, #cs do - print(tostring(cs[i][1]) .. " : " .. tostring(cs[i][3]) .. " : " .. tostring(cs[i][2])) -end