Lines Matching full:raw

71     luaL_loadstring(raw(state), (std::string("return ") + symbol).c_str());  in is_available()
72 const bool ok = (lua_pcall(raw(state), 0, 1, 0) == 0 && in is_available()
73 !lua_isnil(raw(state), -1)); in is_available()
74 lua_pop(raw(state), 1); in is_available()
105 /// \param raw_state The raw Lua state.
131 const int f1 = lua_tointeger(raw(state), lua_upvalueindex(1)); in cxx_multiply_closure()
132 const int f2 = lua_tointeger(raw(state), -1); in cxx_multiply_closure()
133 lua_pushinteger(raw(state), f1 * f2); in cxx_multiply_closure()
203 ATF_REQUIRE(luaL_dostring(raw(state), "test_variable = 3") == 0); in ATF_TEST_CASE_BODY()
205 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
206 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
215 ATF_REQUIRE(lua_isnil(raw(state), -1)); in ATF_TEST_CASE_BODY()
216 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
224 ATF_REQUIRE(luaL_dostring(raw(state), "global_variable = 'hello'") == 0); in ATF_TEST_CASE_BODY()
226 lua_pushstring(raw(state), "global_variable"); in ATF_TEST_CASE_BODY()
227 lua_gettable(raw(state), -2); in ATF_TEST_CASE_BODY()
228 ATF_REQUIRE(lua_isstring(raw(state), -1)); in ATF_TEST_CASE_BODY()
229 ATF_REQUIRE(std::strcmp("hello", lua_tostring(raw(state), -1)) == 0); in ATF_TEST_CASE_BODY()
230 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
238 luaL_openlibs(raw(state)); in ATF_TEST_CASE_BODY()
239 ATF_REQUIRE(luaL_dostring(raw(state), "meta = { foo = 567 }; " in ATF_TEST_CASE_BODY()
241 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
243 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
244 ATF_REQUIRE_EQ(567, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
245 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
253 luaL_openlibs(raw(state)); in ATF_TEST_CASE_BODY()
254 ATF_REQUIRE(luaL_dostring(raw(state), "meta = { foo = 567 }; " in ATF_TEST_CASE_BODY()
256 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
258 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
266 luaL_openlibs(raw(state)); in ATF_TEST_CASE_BODY()
267 ATF_REQUIRE(luaL_dostring(raw(state), "meta = { foo = 567 }; " in ATF_TEST_CASE_BODY()
269 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
270 lua_pushinteger(raw(state), 5555); in ATF_TEST_CASE_BODY()
272 ATF_REQUIRE(lua_istable(raw(state), -1)); in ATF_TEST_CASE_BODY()
273 lua_pushstring(raw(state), "foo"); in ATF_TEST_CASE_BODY()
274 lua_gettable(raw(state), -2); in ATF_TEST_CASE_BODY()
275 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
276 ATF_REQUIRE_EQ(567, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
277 lua_pop(raw(state), 4); in ATF_TEST_CASE_BODY()
285 ATF_REQUIRE(luaL_dostring(raw(state), "t = {}") == 0); in ATF_TEST_CASE_BODY()
286 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
288 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
296 ATF_REQUIRE(luaL_dostring(raw(state), "t = { a = 1, bar = 234 }") == 0); in ATF_TEST_CASE_BODY()
297 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
298 lua_pushstring(raw(state), "bar"); in ATF_TEST_CASE_BODY()
300 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
301 ATF_REQUIRE_EQ(234, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
302 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
310 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
311 lua_pushinteger(raw(state), 1); in ATF_TEST_CASE_BODY()
313 ATF_REQUIRE_EQ(2, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
314 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
322 ATF_REQUIRE(luaL_dostring(raw(state), in ATF_TEST_CASE_BODY()
324 lua_getglobal(raw(state), "the_table"); in ATF_TEST_CASE_BODY()
325 lua_pushstring(raw(state), "baz"); in ATF_TEST_CASE_BODY()
327 ATF_REQUIRE(lua_isnil(raw(state), -1)); in ATF_TEST_CASE_BODY()
328 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
337 lua_pushinteger(raw(state), 3); in ATF_TEST_CASE_BODY()
339 lua_pushinteger(raw(state), 3); in ATF_TEST_CASE_BODY()
341 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
349 lua_pushinteger(raw(state), 1); in ATF_TEST_CASE_BODY()
350 lua_pushinteger(raw(state), 2); in ATF_TEST_CASE_BODY()
351 lua_pushinteger(raw(state), 3); in ATF_TEST_CASE_BODY()
352 lua_pushinteger(raw(state), 4); in ATF_TEST_CASE_BODY()
354 ATF_REQUIRE_EQ(3, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
355 ATF_REQUIRE_EQ(2, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
356 ATF_REQUIRE_EQ(4, lua_tointeger(raw(state), -3)); in ATF_TEST_CASE_BODY()
357 ATF_REQUIRE_EQ(1, lua_tointeger(raw(state), -4)); in ATF_TEST_CASE_BODY()
358 lua_pop(raw(state), 4); in ATF_TEST_CASE_BODY()
374 lua_pushboolean(raw(state), 1); in ATF_TEST_CASE_BODY()
376 lua_pushinteger(raw(state), 5); in ATF_TEST_CASE_BODY()
379 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
395 luaL_dostring(raw(state), "function my_func(a, b) return a + b; end"); in ATF_TEST_CASE_BODY()
397 lua_getglobal(raw(state), "my_func"); in ATF_TEST_CASE_BODY()
399 lua_pushinteger(raw(state), 5); in ATF_TEST_CASE_BODY()
402 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
418 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
420 lua_pushinteger(raw(state), 5); in ATF_TEST_CASE_BODY()
423 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
439 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
441 lua_pushinteger(raw(state), 5); in ATF_TEST_CASE_BODY()
444 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
460 lua_pushinteger(raw(state), 3); in ATF_TEST_CASE_BODY()
462 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
465 lua_pushstring(raw(state), "foo"); in ATF_TEST_CASE_BODY()
469 lua_pop(raw(state), 3); in ATF_TEST_CASE_BODY()
485 luaL_dostring(raw(state), "t = {3, 4, 5}"); in ATF_TEST_CASE_BODY()
487 lua_pushstring(raw(state), "foo"); in ATF_TEST_CASE_BODY()
489 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
492 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
509 lua_pushstring(raw(state), "foo"); in ATF_TEST_CASE_BODY()
511 lua_newuserdata(raw(state), 543); in ATF_TEST_CASE_BODY()
514 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
527 ATF_REQUIRE(lua_pcall(raw(state), 0, 0, 0) == 0); in ATF_TEST_CASE_BODY()
528 lua_getglobal(raw(state), "in_the_file"); in ATF_TEST_CASE_BODY()
529 ATF_REQUIRE(std::strcmp("oh yes", lua_tostring(raw(state), -1)) == 0); in ATF_TEST_CASE_BODY()
530 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
560 ATF_REQUIRE(lua_pcall(raw(state), 0, 1, 0) == 0); in ATF_TEST_CASE_BODY()
561 ATF_REQUIRE_EQ(5, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
562 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
579 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
580 ATF_REQUIRE(lua_istable(raw(state), -1)); in ATF_TEST_CASE_BODY()
581 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
591 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
592 ATF_REQUIRE(lua_isuserdata(raw(state), -1)); in ATF_TEST_CASE_BODY()
593 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
601 luaL_dostring(raw(state), "t = {}"); in ATF_TEST_CASE_BODY()
603 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
604 lua_pushstring(raw(state), "this is a dummy value"); in ATF_TEST_CASE_BODY()
605 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
607 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
615 luaL_dostring(raw(state), "t = {}; t[1] = 100; t[2] = 200"); in ATF_TEST_CASE_BODY()
617 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
618 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
621 ATF_REQUIRE_EQ(3, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
622 ATF_REQUIRE(lua_isnumber(raw(state), -2)); in ATF_TEST_CASE_BODY()
623 ATF_REQUIRE_EQ(1, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
624 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
625 ATF_REQUIRE_EQ(100, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
626 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
629 ATF_REQUIRE_EQ(3, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
630 ATF_REQUIRE(lua_isnumber(raw(state), -2)); in ATF_TEST_CASE_BODY()
631 ATF_REQUIRE_EQ(2, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
632 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
633 ATF_REQUIRE_EQ(200, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
634 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
637 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
690 luaL_loadstring(raw(state), "function mul(a, b) return a * b; end"); in ATF_TEST_CASE_BODY()
693 lua_pushstring(raw(state), "mul"); in ATF_TEST_CASE_BODY()
694 lua_gettable(raw(state), -2); in ATF_TEST_CASE_BODY()
695 lua_pushinteger(raw(state), 3); in ATF_TEST_CASE_BODY()
696 lua_pushinteger(raw(state), 5); in ATF_TEST_CASE_BODY()
698 ATF_REQUIRE_EQ(15, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
699 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
707 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
716 lua_pushinteger(raw(state), 10); in ATF_TEST_CASE_BODY()
717 lua_pushinteger(raw(state), 20); in ATF_TEST_CASE_BODY()
718 lua_pushinteger(raw(state), 30); in ATF_TEST_CASE_BODY()
720 ATF_REQUIRE_EQ(2, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
721 ATF_REQUIRE_EQ(20, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
722 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
730 lua_pushinteger(raw(state), 10); in ATF_TEST_CASE_BODY()
731 lua_pushinteger(raw(state), 20); in ATF_TEST_CASE_BODY()
732 lua_pushinteger(raw(state), 30); in ATF_TEST_CASE_BODY()
734 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
735 ATF_REQUIRE_EQ(10, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
736 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
745 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
746 ATF_REQUIRE(lua_toboolean(raw(state), -1)); in ATF_TEST_CASE_BODY()
748 ATF_REQUIRE_EQ(2, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
749 ATF_REQUIRE(!lua_toboolean(raw(state), -1)); in ATF_TEST_CASE_BODY()
750 ATF_REQUIRE(lua_toboolean(raw(state), -2)); in ATF_TEST_CASE_BODY()
751 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
761 lua_setglobal(raw(state), "cxx_multiply_closure"); in ATF_TEST_CASE_BODY()
763 ATF_REQUIRE(luaL_dostring(raw(state), in ATF_TEST_CASE_BODY()
765 ATF_REQUIRE_EQ(150, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
766 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
775 lua_setglobal(raw(state), "cxx_divide"); in ATF_TEST_CASE_BODY()
777 ATF_REQUIRE(luaL_dostring(raw(state), "return cxx_divide(17, 3)") == 0); in ATF_TEST_CASE_BODY()
778 ATF_REQUIRE_EQ(5, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
779 ATF_REQUIRE_EQ(2, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
780 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
789 lua_setglobal(raw(state), "cxx_divide"); in ATF_TEST_CASE_BODY()
791 ATF_REQUIRE(luaL_dostring(raw(state), "return cxx_divide(15, 0)") != 0); in ATF_TEST_CASE_BODY()
792 ATF_REQUIRE_MATCH("Divisor is 0", lua_tostring(raw(state), -1)); in ATF_TEST_CASE_BODY()
793 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
802 lua_setglobal(raw(state), "cxx_divide"); in ATF_TEST_CASE_BODY()
804 ATF_REQUIRE(luaL_dostring(raw(state), "return cxx_divide(-3, -1)") != 0); in ATF_TEST_CASE_BODY()
805 ATF_REQUIRE_MATCH("Unhandled exception", lua_tostring(raw(state), -1)); in ATF_TEST_CASE_BODY()
806 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
815 lua_setglobal(raw(state), "fail"); in ATF_TEST_CASE_BODY()
817 ATF_REQUIRE(luaL_dostring(raw(state), "return fail(900)") != 0); in ATF_TEST_CASE_BODY()
818 ATF_REQUIRE_MATCH(std::string(900, 'A'), lua_tostring(raw(state), -1)); in ATF_TEST_CASE_BODY()
819 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
821 ATF_REQUIRE(luaL_dostring(raw(state), "return fail(8192)") != 0); in ATF_TEST_CASE_BODY()
822 ATF_REQUIRE_MATCH(std::string(900, 'A'), lua_tostring(raw(state), -1)); in ATF_TEST_CASE_BODY()
823 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
832 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
833 ATF_REQUIRE_EQ(12, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
835 ATF_REQUIRE_EQ(2, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
836 ATF_REQUIRE_EQ(34, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
837 ATF_REQUIRE_EQ(12, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
838 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
847 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
848 ATF_REQUIRE(lua_isnil(raw(state), -1)); in ATF_TEST_CASE_BODY()
850 ATF_REQUIRE_EQ(2, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
851 ATF_REQUIRE(!lua_isnil(raw(state), -1)); in ATF_TEST_CASE_BODY()
852 ATF_REQUIRE(lua_isnil(raw(state), -2)); in ATF_TEST_CASE_BODY()
853 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
865 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
866 ATF_REQUIRE_EQ(std::string("first"), lua_tostring(raw(state), -1)); in ATF_TEST_CASE_BODY()
870 ATF_REQUIRE_EQ(2, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
871 ATF_REQUIRE_EQ(std::string("second"), lua_tostring(raw(state), -1)); in ATF_TEST_CASE_BODY()
872 ATF_REQUIRE_EQ(std::string("first"), lua_tostring(raw(state), -2)); in ATF_TEST_CASE_BODY()
873 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
882 lua_pushinteger(raw(state), 10); in ATF_TEST_CASE_BODY()
883 lua_pushinteger(raw(state), 20); in ATF_TEST_CASE_BODY()
885 ATF_REQUIRE_EQ(3, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
886 ATF_REQUIRE_EQ(10, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
887 ATF_REQUIRE_EQ(20, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
888 ATF_REQUIRE_EQ(10, lua_tointeger(raw(state), -3)); in ATF_TEST_CASE_BODY()
889 lua_pop(raw(state), 3); in ATF_TEST_CASE_BODY()
898 luaL_openlibs(raw(state)); in ATF_TEST_CASE_BODY()
900 raw(state), "t = {foo=123} ; setmetatable(t, {__index=1})") == 0); in ATF_TEST_CASE_BODY()
901 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
902 lua_pushinteger(raw(state), 9876); in ATF_TEST_CASE_BODY()
903 lua_pushstring(raw(state), "foo"); in ATF_TEST_CASE_BODY()
905 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
906 ATF_REQUIRE_EQ(123, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
907 ATF_REQUIRE_EQ(9876, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
908 lua_pop(raw(state), 3); in ATF_TEST_CASE_BODY()
917 luaL_openlibs(raw(state)); in ATF_TEST_CASE_BODY()
919 raw(state), "t = {} ; setmetatable(t, {__newindex=1})") == 0); in ATF_TEST_CASE_BODY()
920 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
921 lua_pushinteger(raw(state), 876); in ATF_TEST_CASE_BODY()
922 lua_pushstring(raw(state), "foo"); in ATF_TEST_CASE_BODY()
923 lua_pushinteger(raw(state), 345); in ATF_TEST_CASE_BODY()
925 ATF_REQUIRE(luaL_dostring(raw(state), "return t.foo") == 0); in ATF_TEST_CASE_BODY()
926 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
927 ATF_REQUIRE_EQ(345, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
928 ATF_REQUIRE_EQ(876, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
929 lua_pop(raw(state), 3); in ATF_TEST_CASE_BODY()
937 lua_pushvalue(raw(state), lutok::registry_index); in ATF_TEST_CASE_BODY()
938 lua_pushstring(raw(state), "custom_variable"); in ATF_TEST_CASE_BODY()
939 lua_pushstring(raw(state), "custom value"); in ATF_TEST_CASE_BODY()
940 lua_settable(raw(state), -3); in ATF_TEST_CASE_BODY()
941 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
942 ATF_REQUIRE(luaL_dostring(raw(state), in ATF_TEST_CASE_BODY()
944 ATF_REQUIRE(lua_isboolean(raw(state), -1)); in ATF_TEST_CASE_BODY()
945 ATF_REQUIRE(lua_toboolean(raw(state), -1)); in ATF_TEST_CASE_BODY()
946 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
954 lua_pushinteger(raw(state), 3); in ATF_TEST_CASE_BODY()
956 ATF_REQUIRE(luaL_dostring(raw(state), "return test_variable + 1") == 0); in ATF_TEST_CASE_BODY()
957 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
958 ATF_REQUIRE_EQ(4, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
959 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
968 raw(state), in ATF_TEST_CASE_BODY()
974 lua_getglobal(raw(state), "numbers"); in ATF_TEST_CASE_BODY()
975 lua_pushinteger(raw(state), 1234); in ATF_TEST_CASE_BODY()
976 lua_getglobal(raw(state), "mt"); in ATF_TEST_CASE_BODY()
978 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
980 ATF_REQUIRE(luaL_dostring(raw(state), "return numbers + 2") == 0); in ATF_TEST_CASE_BODY()
981 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
982 ATF_REQUIRE_EQ(7, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
983 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
991 ATF_REQUIRE(luaL_dostring(raw(state), "t = { a = 1, bar = 234 }") == 0); in ATF_TEST_CASE_BODY()
992 lua_getglobal(raw(state), "t"); in ATF_TEST_CASE_BODY()
994 lua_pushstring(raw(state), "bar"); in ATF_TEST_CASE_BODY()
995 lua_pushstring(raw(state), "baz"); in ATF_TEST_CASE_BODY()
997 ATF_REQUIRE_EQ(1, lua_gettop(raw(state))); in ATF_TEST_CASE_BODY()
999 lua_pushstring(raw(state), "a"); in ATF_TEST_CASE_BODY()
1000 lua_gettable(raw(state), -2); in ATF_TEST_CASE_BODY()
1001 ATF_REQUIRE(lua_isnumber(raw(state), -1)); in ATF_TEST_CASE_BODY()
1002 ATF_REQUIRE_EQ(1, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
1003 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
1005 lua_pushstring(raw(state), "bar"); in ATF_TEST_CASE_BODY()
1006 lua_gettable(raw(state), -2); in ATF_TEST_CASE_BODY()
1007 ATF_REQUIRE(lua_isstring(raw(state), -1)); in ATF_TEST_CASE_BODY()
1008 ATF_REQUIRE_EQ(std::string("baz"), lua_tostring(raw(state), -1)); in ATF_TEST_CASE_BODY()
1009 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
1011 lua_pop(raw(state), 1); in ATF_TEST_CASE_BODY()
1019 lua_pushnil(raw(state)); in ATF_TEST_CASE_BODY()
1020 lua_pushinteger(raw(state), 1); in ATF_TEST_CASE_BODY()
1021 lua_pushinteger(raw(state), 2); in ATF_TEST_CASE_BODY()
1023 lua_pop(raw(state), 3); in ATF_TEST_CASE_BODY()
1031 lua_pushboolean(raw(state), 0); in ATF_TEST_CASE_BODY()
1032 lua_pushboolean(raw(state), 1); in ATF_TEST_CASE_BODY()
1035 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
1043 lua_pushinteger(raw(state), 12); in ATF_TEST_CASE_BODY()
1044 lua_pushstring(raw(state), "foobar"); in ATF_TEST_CASE_BODY()
1046 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
1054 lua_pushstring(raw(state), "foobar"); in ATF_TEST_CASE_BODY()
1055 lua_pushinteger(raw(state), 12); in ATF_TEST_CASE_BODY()
1058 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
1068 lua_newuserdata(raw(state), sizeof(int))); in ATF_TEST_CASE_BODY()
1072 lua_pushinteger(raw(state), 3); in ATF_TEST_CASE_BODY()
1075 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()
1083 lua_pushinteger(raw(state), 25); in ATF_TEST_CASE_BODY()
1084 lua_pushinteger(raw(state), 30); in ATF_TEST_CASE_BODY()
1085 lua_pushcclosure(raw(state), c_get_upvalues, 2); in ATF_TEST_CASE_BODY()
1086 lua_setglobal(raw(state), "c_get_upvalues"); in ATF_TEST_CASE_BODY()
1088 ATF_REQUIRE(luaL_dostring(raw(state), in ATF_TEST_CASE_BODY()
1090 ATF_REQUIRE_EQ(25, lua_tointeger(raw(state), -2)); in ATF_TEST_CASE_BODY()
1091 ATF_REQUIRE_EQ(30, lua_tointeger(raw(state), -1)); in ATF_TEST_CASE_BODY()
1092 lua_pop(raw(state), 2); in ATF_TEST_CASE_BODY()