test(lua): add .olean corrupted file tests

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-05-31 12:51:33 -07:00
parent 75abcea83f
commit 37b5570e99
7 changed files with 20 additions and 1 deletions

View file

@ -6,6 +6,6 @@ function check_error(f)
if ok then if ok then
error("unexpected success...") error("unexpected success...")
else else
print("caught expected error: ", msg) print("caught expected error: ", msg:what())
end end
end end

3
tests/lua/mod3.lua Normal file
View file

@ -0,0 +1,3 @@
local env = environment()
env = add_decl(env, mk_var_decl("A", Type))
env:export("mod3_mod.olean")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

16
tests/lua/mod3b.lua Normal file
View file

@ -0,0 +1,16 @@
check_error(function()
local env = import_modules("mod3_corrupted1")
end
)
check_error(function()
local env = import_modules("mod3_corrupted2")
end
)
check_error(function()
local env = import_modules("mod3_corrupted3")
end
)
check_error(function()
local env = import_modules("mod3_corrupted4")
end
)