From 5bfa8e8b142ae010b9557f1025c2ecf15c97e750 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 16 Apr 2015 15:36:17 +0100 Subject: [PATCH] elua lib: test raw file load --- src/tests/elua/elua_lib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tests/elua/elua_lib.c b/src/tests/elua/elua_lib.c index 4bf77962d1..aa4e1be340 100644 --- a/src/tests/elua/elua_lib.c +++ b/src/tests/elua/elua_lib.c @@ -65,6 +65,12 @@ START_TEST(elua_api) fail_if(elua_util_app_load(st, "non_existent_app")); fail_if(lua_type(lst, -1) != LUA_TSTRING); lua_pop(lst, 1); + fail_if(elua_io_loadfile(st, ELUA_CORE_DIR "/util.lua")); + fail_if(lua_type(lst, -1) != LUA_TFUNCTION); + lua_pop(lst, 1); + fail_if(!elua_io_loadfile(st, ELUA_CORE_DIR "/non_existent_file.lua")); + fail_if(lua_type(lst, -1) != LUA_TSTRING); + lua_pop(lst, 1); /* halfassed testing here, but not possible otherwise */ fail_if(elua_util_error_report(st, "foo", 0));