test_table.cpp 926 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright Daniel Wallin 2009. Use, modification and distribution is
  2. // subject to the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include "test.hpp"
  5. #include <luabind/luabind.hpp>
  6. void f(luabind::table<> const& x)
  7. {
  8. TEST_CHECK(luabind::type(x) == LUA_TTABLE);
  9. }
  10. void g(luabind::table<luabind::argument> const& x)
  11. {
  12. TEST_CHECK(luabind::type(x) == LUA_TTABLE);
  13. }
  14. void test_main(lua_State* L)
  15. {
  16. using namespace luabind;
  17. module(L) [
  18. def("f", &f),
  19. def("g", &g)
  20. ];
  21. DOSTRING(L,
  22. "f {1,2,3}\n"
  23. "g {1,2,3}\n"
  24. );
  25. DOSTRING_EXPECTED(L,
  26. "f(1)\n",
  27. "No matching overload found, candidates:\n"
  28. "void f(table const&)"
  29. );
  30. DOSTRING_EXPECTED(L,
  31. "g(1)\n",
  32. "No matching overload found, candidates:\n"
  33. "void g(table const&)"
  34. );
  35. }