diff options
-rw-r--r-- | main.c | 8 | ||||
-rw-r--r-- | tests/cram/test_basic.t | 6 |
2 files changed, 9 insertions, 5 deletions
@@ -435,7 +435,7 @@ parse_library_load(char *opt, uc_vm_t *vm) ucv_put(lib); if (!ctx) - return false; + return vm->exception.type == EXCEPTION_NONE; ucv_object_add(uc_vm_scope_get(vm), name ? name : p, ctx); @@ -557,7 +557,11 @@ main(int argc, char **argv) break; case 'l': - parse_library_load(optarg, &vm); + if (!parse_library_load(optarg, &vm)) { + rv = 1; + goto out; + } + break; case 'c': diff --git a/tests/cram/test_basic.t b/tests/cram/test_basic.t index b85167f..7308002 100644 --- a/tests/cram/test_basic.t +++ b/tests/cram/test_basic.t @@ -79,19 +79,19 @@ check that ucode prints greetings: check that ucode provides proper error messages: - $ ucode -l foo + $ touch lib.uc; ucode -l lib Require either -e expression or source file [1] $ ucode -l foo -e ' ' Runtime error: No module named 'foo' could be found - [254] + [1] $ touch moo; ucode -l foo moo Runtime error: No module named 'foo' could be found - [254] + [1] check that ucode can load fs module: |