diff --git a/tests/lua/extra.lua b/tests/lua/extra.lua index ccd3ccac8..57c498be8 100644 --- a/tests/lua/extra.lua +++ b/tests/lua/extra.lua @@ -6,6 +6,6 @@ function check_error(f) if ok then error("unexpected success...") else - print("caught expected error: ", msg) + print("caught expected error: ", msg:what()) end end diff --git a/tests/lua/mod3.lua b/tests/lua/mod3.lua new file mode 100644 index 000000000..16aed815d --- /dev/null +++ b/tests/lua/mod3.lua @@ -0,0 +1,3 @@ +local env = environment() +env = add_decl(env, mk_var_decl("A", Type)) +env:export("mod3_mod.olean") diff --git a/tests/lua/mod3_corrupted1.olean b/tests/lua/mod3_corrupted1.olean new file mode 100644 index 000000000..52441c407 Binary files /dev/null and b/tests/lua/mod3_corrupted1.olean differ diff --git a/tests/lua/mod3_corrupted2.olean b/tests/lua/mod3_corrupted2.olean new file mode 100644 index 000000000..e8a133d86 Binary files /dev/null and b/tests/lua/mod3_corrupted2.olean differ diff --git a/tests/lua/mod3_corrupted3.olean b/tests/lua/mod3_corrupted3.olean new file mode 100644 index 000000000..7853e41ed Binary files /dev/null and b/tests/lua/mod3_corrupted3.olean differ diff --git a/tests/lua/mod3_corrupted4.olean b/tests/lua/mod3_corrupted4.olean new file mode 100644 index 000000000..e55ebd035 Binary files /dev/null and b/tests/lua/mod3_corrupted4.olean differ diff --git a/tests/lua/mod3b.lua b/tests/lua/mod3b.lua new file mode 100644 index 000000000..00213f5af --- /dev/null +++ b/tests/lua/mod3b.lua @@ -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 +)