update single, add new tests

fixes #564
This commit is contained in:
ThePhD 2018-01-24 01:10:35 -05:00
parent 83f4b4aaa0
commit 143c98450a
9 changed files with 21798 additions and 21698 deletions

230
.gitignore vendored
View File

@ -1,115 +1,115 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Python (Bytecode)
*.pyc
# ninja files
*.ninja
# Visual Studio
*.props
*.user
.vs/
Debug/
Release/
x64/
x86/
*.pyproj
*.vcxproj
*.vcxproj.filters
*.tlog
*.lastbuildstate
*.idb
*.sln
*.gitattributes
# VSCode
.vscode/
# CMake
build/
build-sol2/
CMakeCache.txt
CMakeFiles/
# Compiler outputs
obj/*
bin/*
main.exe
main.o
lua53.dll
lua-5.3.4.dll
main.ilk
main.pdb
# Dropbox interference
.dropbox*
# QtCreator
*.creator.user.*
*.config
*.creator
*.files
*.includes
# Scratchpad Files
m.lua
main.lua
catch_mock.hpp
main_aux.cpp
main.hpp
main2.cpp
main.cpp
# Local Lua Testbeds
lua-5.3.4-cxx/
lua-5.3.4/
lua-5.3.2/
lua-5.3.1/
lua-5.3.0/
lua-5.2.4/
lua-5.2.2/
lua-5.2.3/
lua-5.1.5/
LuaJIT-2.1.0/
luajit-2.0.5/
luajit-2.0.3/
include/
liblua.a
lib/liblua5.2.a
# Docs Artefacts
docs/build/
# Sublime Text
*.sublime-workspace
*.sublime-project
# Windows Crap
desktop.ini
*.db
# Miscellaneous
external/
scratch/
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Python (Bytecode)
*.pyc
# ninja files
*.ninja
# Visual Studio
*.props
*.user
.vs/
Debug/
Release/
x64/
x86/
*.pyproj
*.vcxproj
*.vcxproj.filters
*.tlog
*.lastbuildstate
*.idb
*.sln
*.gitattributes
# VSCode
.vscode/
# CMake
build/
build-sol2/
CMakeCache.txt
CMakeFiles/
# Compiler outputs
obj/*
bin/*
main.exe
main.o
lua53.dll
lua-5.3.4.dll
main.ilk
main.pdb
# Dropbox interference
.dropbox*
# QtCreator
*.creator.user.*
*.config
*.creator
*.files
*.includes
# Scratchpad Files
m.lua
main.lua
catch_mock.hpp
main_aux.cpp
main.hpp
main2.cpp
main.cpp
# Local Lua Testbeds
lua-5.3.4-cxx/
lua-5.3.4/
lua-5.3.2/
lua-5.3.1/
lua-5.3.0/
lua-5.2.4/
lua-5.2.2/
lua-5.2.3/
lua-5.1.5/
LuaJIT-2.1.0/
luajit-2.0.5/
luajit-2.0.3/
include/
liblua.a
lib/liblua5.2.a
# Docs Artefacts
docs/build/
# Sublime Text
*.sublime-workspace
*.sublime-project
# Windows Crap
desktop.ini
*.db
# Miscellaneous
external/
scratch/

View File

@ -1,112 +1,120 @@
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# # Standard CMake Libraries
include(FindPackageHandleStandardArgs)
# Contain literally everything inside of this function to prevent spillage
function(find_lua_build LUA_VERSION)
# # # Variables
# # Core Paths
string(TOLOWER ${LUA_VERSION} LUA_BUILD_NORMALIZED_LUA_VERSION)
if (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
elseif (BUILD_LUAJIT)
set(LUA_BUILD_LIBNAME luajit-${LUA_VERSION})
elseif (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "lua")
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
elseif (BUILD_LUA)
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
else()
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
endif()
set(LUA_BUILD_TOPLEVEL "${CMAKE_BINARY_DIR}/vendor/${LUA_BUILD_LIBNAME}")
set(LUA_BUILD_INSTALL_DIR "${LUA_BUILD_TOPLEVEL}")
# # Misc needed variables
set(LUA_BUILD_LIBRARY_DESCRIPTION "The base name of the library to build either the static or the dynamic library")
# Object file suffixes
if (MSVC)
set(LUA_BUILD_BUILD_DLL_DEFAULT ON)
set(LUA_BUILD_OBJECT_FILE_SUFFIX .obj)
else()
set(LUA_BUILD_BUILD_DLL_DEFAULT OFF)
set(LUA_BUILD_OBJECT_FILE_SUFFIX .o)
endif()
# # # Options
option(BUILD_LUA_AS_DLL ${LUA_BUILD_BUILD_DLL_DEFAULT} "Build Lua or LuaJIT as a Shared/Dynamic Link Library")
STRING(TOLOWER ${LUA_BUILD_LIBNAME} LUA_BUILD_NORMALIZED_LIBNAME)
if (NOT LUA_LIBRARY_NAME)
if (LUA_BUILD_NORMALIZED_LIBNAME MATCHES "luajit")
set(LUA_LIBRARY luajit)
else()
set(LUA_LIBRARY ${LUA_BUILD_LIBNAME})
endif()
else()
set(LUA_LIBRARY_NAME ${LUA_LIBRARY_NAME}
CACHE STRING
${LUA_BUILD_LIBRARY_DESCRIPTION})
endif()
# # Dependent Variables
# If we're building a DLL, then set the library type to SHARED
if (BUILD_LUA_AS_DLL)
set(LUA_BUILD_LIBRARY_TYPE SHARED)
else()
set(LUA_BUILD_LIBRARY_TYPE STATIC)
endif()
# # # Build Lua
# # Select either LuaJIT or Vanilla Lua here, based on what we discover
if (BUILD_LUAJIT OR LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaJIT.cmake)
set(LUA_VERSION_STRING ${LUA_JIT_VERSION})
else()
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaVanilla.cmake)
set(LUA_VERSION_STRING ${LUA_VANILLA_VERSION})
endif()
# # Export variables to the parent scope
set(LUA_LIBRARIES ${LUA_LIBRARIES} PARENT_SCOPE)
set(LUA_INTERPRETER ${LUA_INTERPRETER} PARENT_SCOPE)
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
set(LUABUILD_FOUND TRUE PARENT_SCOPE)
endfunction(find_lua_build)
# Call and then immediately undefine to avoid polluting the global scope
if (LuaBuild_FIND_COMPONENTS)
list(GET LuaBuild_FIND_COMPONENTS 0 LUA_VERSION)
else()
set(LUA_VERSION 5.3.4)
endif()
find_lua_build(${LUA_VERSION})
unset(find_lua_build)
# handle the QUIETLY and REQUIRED arguments and set LUABUILD_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaBuild
FOUND_VAR LUABUILD_FOUND
REQUIRED_VARS LUA_LIBRARIES LUA_INTERPRETER
VERSION_VAR LUA_VERSION_STRING)
# # # # sol2
# The MIT License (MIT)
#
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# # Standard CMake Libraries
include(FindPackageHandleStandardArgs)
# Contain literally everything inside of this function to prevent spillage
function(find_lua_build LUA_VERSION)
# # # Variables
# # Core Paths
string(TOLOWER ${LUA_VERSION} LUA_BUILD_NORMALIZED_LUA_VERSION)
if (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
elseif (BUILD_LUAJIT)
set(LUA_BUILD_LIBNAME luajit-${LUA_VERSION})
elseif (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "lua")
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
elseif (BUILD_LUA)
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
else()
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
endif()
set(LUA_BUILD_TOPLEVEL "${CMAKE_BINARY_DIR}/vendor/${LUA_BUILD_LIBNAME}")
set(LUA_BUILD_INSTALL_DIR "${LUA_BUILD_TOPLEVEL}")
# # Misc needed variables
set(LUA_BUILD_LIBRARY_DESCRIPTION "The base name of the library to build either the static or the dynamic library")
# Object file suffixes
if (MSVC)
set(LUA_BUILD_BUILD_DLL_DEFAULT ON)
set(LUA_BUILD_OBJECT_FILE_SUFFIX .obj)
else()
set(LUA_BUILD_BUILD_DLL_DEFAULT OFF)
set(LUA_BUILD_OBJECT_FILE_SUFFIX .o)
endif()
# # # Options
option(BUILD_LUA_AS_DLL ${LUA_BUILD_BUILD_DLL_DEFAULT} "Build Lua or LuaJIT as a Shared/Dynamic Link Library")
STRING(TOLOWER ${LUA_BUILD_LIBNAME} LUA_BUILD_NORMALIZED_LIBNAME)
if (NOT LUA_LIBRARY_NAME)
if (LUA_BUILD_NORMALIZED_LIBNAME MATCHES "luajit")
set(LUA_LIBRARY luajit)
else()
set(LUA_LIBRARY ${LUA_BUILD_LIBNAME})
endif()
else()
set(LUA_LIBRARY_NAME ${LUA_LIBRARY_NAME}
CACHE STRING
${LUA_BUILD_LIBRARY_DESCRIPTION})
endif()
# # Dependent Variables
# If we're building a DLL, then set the library type to SHARED
if (BUILD_LUA_AS_DLL)
set(LUA_BUILD_LIBRARY_TYPE SHARED)
else()
set(LUA_BUILD_LIBRARY_TYPE STATIC)
endif()
# # # Build Lua
# # Select either LuaJIT or Vanilla Lua here, based on what we discover
if (BUILD_LUAJIT OR LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaJIT.cmake)
set(LUA_VERSION_STRING ${LUA_JIT_VERSION})
else()
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaVanilla.cmake)
set(LUA_VERSION_STRING ${LUA_VANILLA_VERSION})
endif()
# # Export variables to the parent scope
set(LUA_LIBRARIES ${LUA_LIBRARIES} PARENT_SCOPE)
set(LUA_INTERPRETER ${LUA_INTERPRETER} PARENT_SCOPE)
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
set(LUABUILD_FOUND TRUE PARENT_SCOPE)
endfunction(find_lua_build)
# Call and then immediately undefine to avoid polluting the global scope
if (LuaBuild_FIND_COMPONENTS)
list(GET LuaBuild_FIND_COMPONENTS 0 LUA_VERSION)
endif()
if (LuaBuild_VERSION)
if (LUA_VERSION)
set(LUA_VERSION "${LUA_VERSION}-${LuaBuild_VERSION}")
else()
set(LUA_VERSION "${LuaBuild_VERSION}")
endif()
endif()
if (NOT LUA_VERSION)
set(LUA_VERSION 5.3.4)
endif()
find_lua_build(${LUA_VERSION})
unset(find_lua_build)
# handle the QUIETLY and REQUIRED arguments and set LUABUILD_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaBuild
FOUND_VAR LUABUILD_FOUND
REQUIRED_VARS LUA_LIBRARIES LUA_INTERPRETER
VERSION_VAR LUA_VERSION_STRING)

File diff suppressed because it is too large Load Diff

View File

@ -1,292 +1,292 @@
// The MIT License (MIT)
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2018-01-24 00:50:30.920977 UTC
// This header was generated with sol v2.19.0 (revision db9c5d6)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
#define SOL_SINGLE_INCLUDE_FORWARD_HPP
// beginning of sol/forward.hpp
// beginning of sol/feature_test.hpp
#if (defined(__cplusplus) && __cplusplus == 201703L) || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L))))
#ifndef SOL_CXX17_FEATURES
#define SOL_CXX17_FEATURES 1
#endif // C++17 features macro
#endif // C++17 features check
#ifdef SOL_CXX17_FEATURES
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201703L) && defined(_WIN64))))
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
#endif // noexcept is part of a function's type
#endif // compiler-specific checks
#endif // C++17 only
#if defined(_WIN32) || defined(_MSC_VER)
#ifndef SOL_CODECVT_SUPPORT
#define SOL_CODECVT_SUPPORT 1
#endif // sol codecvt support
#elif defined(__GNUC__)
#if __GNUC__ >= 5
#ifndef SOL_CODECVT_SUPPORT
#define SOL_CODECVT_SUPPORT 1
#endif // codecvt support
#endif // g++ 5.x.x (MinGW too)
#else
#endif // Windows/VC++ vs. g++ vs Others
#ifdef _MSC_VER
#if defined(_DEBUG) && !defined(NDEBUG)
#ifndef SOL_IN_DEBUG_DETECTED
#define SOL_IN_DEBUG_DETECTED 1
#endif
#endif // VC++ Debug macros
#ifndef _CPPUNWIND
#ifndef SOL_NO_EXCEPTIONS
#define SOL_NO_EXCEPTIONS 1
#endif
#endif // Automatic Exceptions
#ifndef _CPPRTTI
#ifndef SOL_NO_RTTI
#define SOL_NO_RTTI 1
#endif
#endif // Automatic RTTI
#elif defined(__GNUC__) || defined(__clang__)
#if !defined(NDEBUG) && !defined(__OPTIMIZE__)
#ifndef SOL_IN_DEBUG_DETECTED
#define SOL_IN_DEBUG_DETECTED 1
#endif
#endif // Not Debug && g++ optimizer flag
#ifndef __EXCEPTIONS
#ifndef SOL_NO_EXCEPTIONS
#define SOL_NO_EXCEPTIONS 1
#endif
#endif // No Exceptions
#ifndef __GXX_RTTI
#ifndef SOL_NO_RTII
#define SOL_NO_RTTI 1
#endif
#endif // No RTTI
#endif // vc++ || clang++/g++
#if defined(SOL_CHECK_ARGUMENTS)
#if !defined(SOL_SAFE_GETTER)
#define SOL_SAFE_GETTER 1
#endif
#if !defined(SOL_SAFE_USERTYPE)
#define SOL_SAFE_USERTYPE 1
#endif
#if !defined(SOL_SAFE_REFERENCES)
#define SOL_SAFE_REFERENCES 1
#endif
#if !defined(SOL_SAFE_FUNCTION)
#define SOL_SAFE_FUNCTION 1
#endif
#if !defined(SOL_SAFE_FUNCTION_CALLS)
#define SOL_SAFE_FUNCTION_CALLS 1
#endif
#if !defined(SOL_SAFE_PROXIES)
#define SOL_SAFE_PROXIES 1
#endif
#if !defined(SOL_SAFE_NUMERICS)
#define SOL_SAFE_NUMERICS 1
#endif
#endif // Turn on Safety for all if top-level macro is defined
#ifdef SOL_IN_DEBUG_DETECTED
#if !defined(SOL_SAFE_REFERENCES)
#define SOL_SAFE_REFERENCES 1
#endif
#if !defined(SOL_SAFE_USERTYPE)
#define SOL_SAFE_USERTYPE 1
#endif
#if !defined(SOL_SAFE_FUNCTION_CALLS)
#define SOL_SAFE_FUNCTION_CALLS 1
#endif
#endif // Turn on all debug safety features for VC++ / g++ / clang++ and similar
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
#if !defined(SOL_NO_NIL)
#define SOL_NO_NIL 1
#endif
#endif // avoiding nil defines / keywords
// end of sol/feature_test.hpp
namespace sol {
template <bool b>
class basic_reference;
using reference = basic_reference<false>;
using main_reference = basic_reference<true>;
class stack_reference;
struct proxy_base_tag;
template <typename Super>
struct proxy_base;
template <typename Table, typename Key>
struct proxy;
template <typename T>
class usertype;
template <typename T>
class simple_usertype;
template <bool, typename T>
class basic_table_core;
template <bool b>
using table_core = basic_table_core<b, reference>;
template <bool b>
using main_table_core = basic_table_core<b, main_reference>;
template <bool b>
using stack_table_core = basic_table_core<b, stack_reference>;
template <typename T>
using basic_table = basic_table_core<false, T>;
typedef table_core<false> table;
typedef table_core<true> global_table;
typedef main_table_core<false> main_table;
typedef main_table_core<true> main_global_table;
typedef stack_table_core<false> stack_table;
typedef stack_table_core<true> stack_global_table;
template <typename base_t>
struct basic_environment;
using environment = basic_environment<reference>;
using main_environment = basic_environment<main_reference>;
using stack_environment = basic_environment<stack_reference>;
template <typename T, bool>
class basic_function;
template <typename T, bool, typename H>
class basic_protected_function;
using unsafe_function = basic_function<reference, false>;
using safe_function = basic_protected_function<reference, false, reference>;
using main_unsafe_function = basic_function<main_reference, false>;
using main_safe_function = basic_protected_function<main_reference, false, reference>;
using stack_unsafe_function = basic_function<stack_reference, false>;
using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
using protected_function = safe_function;
using main_protected_function = main_safe_function;
using stack_protected_function = stack_safe_function;
using stack_aligned_protected_function = stack_aligned_safe_function;
#ifdef SOL_SAFE_FUNCTION
using function = protected_function;
using main_function = main_protected_function;
using stack_function = stack_protected_function;
#else
using function = unsafe_function;
using main_function = main_unsafe_function;
using stack_function = stack_unsafe_function;
#endif
using stack_aligned_function = stack_aligned_unsafe_function;
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
struct unsafe_function_result;
struct protected_function_result;
using safe_function_result = protected_function_result;
#ifdef SOL_SAFE_FUNCTION
using function_result = safe_function_result;
#else
using function_result = unsafe_function_result;
#endif
template <typename base_t>
class basic_object;
template <typename base_t>
class basic_userdata;
template <typename base_t>
class basic_lightuserdata;
template <typename base_t>
class basic_coroutine;
template <typename base_t>
class basic_thread;
using object = basic_object<reference>;
using userdata = basic_userdata<reference>;
using lightuserdata = basic_lightuserdata<reference>;
using thread = basic_thread<reference>;
using coroutine = basic_coroutine<reference>;
using main_object = basic_object<main_reference>;
using main_userdata = basic_userdata<main_reference>;
using main_lightuserdata = basic_lightuserdata<main_reference>;
using main_coroutine = basic_coroutine<main_reference>;
using stack_object = basic_object<stack_reference>;
using stack_userdata = basic_userdata<stack_reference>;
using stack_lightuserdata = basic_lightuserdata<stack_reference>;
using stack_thread = basic_thread<stack_reference>;
using stack_coroutine = basic_coroutine<stack_reference>;
struct stack_proxy_base;
struct stack_proxy;
struct variadic_args;
struct variadic_results;
struct stack_count;
struct this_state;
struct this_main_state;
struct this_environment;
template <typename T>
struct as_table_t;
template <typename T>
struct as_container_t;
template <typename T>
struct nested;
template <typename T>
struct light;
template <typename T>
struct user;
template <typename T>
struct as_args_t;
template <typename T>
struct protect_t;
template <typename F, typename... Filters>
struct filter_wrapper;
} // namespace sol
// end of sol/forward.hpp
#endif // SOL_SINGLE_INCLUDE_FORWARD_HPP
// The MIT License (MIT)
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2018-01-24 05:51:14.129707 UTC
// This header was generated with sol v2.19.0 (revision 83f4b4a)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
#define SOL_SINGLE_INCLUDE_FORWARD_HPP
// beginning of sol/forward.hpp
// beginning of sol/feature_test.hpp
#if (defined(__cplusplus) && __cplusplus == 201703L) || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L))))
#ifndef SOL_CXX17_FEATURES
#define SOL_CXX17_FEATURES 1
#endif // C++17 features macro
#endif // C++17 features check
#ifdef SOL_CXX17_FEATURES
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201703L) && defined(_WIN64))))
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
#endif // noexcept is part of a function's type
#endif // compiler-specific checks
#endif // C++17 only
#if defined(_WIN32) || defined(_MSC_VER)
#ifndef SOL_CODECVT_SUPPORT
#define SOL_CODECVT_SUPPORT 1
#endif // sol codecvt support
#elif defined(__GNUC__)
#if __GNUC__ >= 5
#ifndef SOL_CODECVT_SUPPORT
#define SOL_CODECVT_SUPPORT 1
#endif // codecvt support
#endif // g++ 5.x.x (MinGW too)
#else
#endif // Windows/VC++ vs. g++ vs Others
#ifdef _MSC_VER
#if defined(_DEBUG) && !defined(NDEBUG)
#ifndef SOL_IN_DEBUG_DETECTED
#define SOL_IN_DEBUG_DETECTED 1
#endif
#endif // VC++ Debug macros
#ifndef _CPPUNWIND
#ifndef SOL_NO_EXCEPTIONS
#define SOL_NO_EXCEPTIONS 1
#endif
#endif // Automatic Exceptions
#ifndef _CPPRTTI
#ifndef SOL_NO_RTTI
#define SOL_NO_RTTI 1
#endif
#endif // Automatic RTTI
#elif defined(__GNUC__) || defined(__clang__)
#if !defined(NDEBUG) && !defined(__OPTIMIZE__)
#ifndef SOL_IN_DEBUG_DETECTED
#define SOL_IN_DEBUG_DETECTED 1
#endif
#endif // Not Debug && g++ optimizer flag
#ifndef __EXCEPTIONS
#ifndef SOL_NO_EXCEPTIONS
#define SOL_NO_EXCEPTIONS 1
#endif
#endif // No Exceptions
#ifndef __GXX_RTTI
#ifndef SOL_NO_RTII
#define SOL_NO_RTTI 1
#endif
#endif // No RTTI
#endif // vc++ || clang++/g++
#if defined(SOL_CHECK_ARGUMENTS)
#if !defined(SOL_SAFE_GETTER)
#define SOL_SAFE_GETTER 1
#endif
#if !defined(SOL_SAFE_USERTYPE)
#define SOL_SAFE_USERTYPE 1
#endif
#if !defined(SOL_SAFE_REFERENCES)
#define SOL_SAFE_REFERENCES 1
#endif
#if !defined(SOL_SAFE_FUNCTION)
#define SOL_SAFE_FUNCTION 1
#endif
#if !defined(SOL_SAFE_FUNCTION_CALLS)
#define SOL_SAFE_FUNCTION_CALLS 1
#endif
#if !defined(SOL_SAFE_PROXIES)
#define SOL_SAFE_PROXIES 1
#endif
#if !defined(SOL_SAFE_NUMERICS)
#define SOL_SAFE_NUMERICS 1
#endif
#endif // Turn on Safety for all if top-level macro is defined
#ifdef SOL_IN_DEBUG_DETECTED
#if !defined(SOL_SAFE_REFERENCES)
#define SOL_SAFE_REFERENCES 1
#endif
#if !defined(SOL_SAFE_USERTYPE)
#define SOL_SAFE_USERTYPE 1
#endif
#if !defined(SOL_SAFE_FUNCTION_CALLS)
#define SOL_SAFE_FUNCTION_CALLS 1
#endif
#endif // Turn on all debug safety features for VC++ / g++ / clang++ and similar
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
#if !defined(SOL_NO_NIL)
#define SOL_NO_NIL 1
#endif
#endif // avoiding nil defines / keywords
// end of sol/feature_test.hpp
namespace sol {
template <bool b>
class basic_reference;
using reference = basic_reference<false>;
using main_reference = basic_reference<true>;
class stack_reference;
struct proxy_base_tag;
template <typename Super>
struct proxy_base;
template <typename Table, typename Key>
struct proxy;
template <typename T>
class usertype;
template <typename T>
class simple_usertype;
template <bool, typename T>
class basic_table_core;
template <bool b>
using table_core = basic_table_core<b, reference>;
template <bool b>
using main_table_core = basic_table_core<b, main_reference>;
template <bool b>
using stack_table_core = basic_table_core<b, stack_reference>;
template <typename T>
using basic_table = basic_table_core<false, T>;
typedef table_core<false> table;
typedef table_core<true> global_table;
typedef main_table_core<false> main_table;
typedef main_table_core<true> main_global_table;
typedef stack_table_core<false> stack_table;
typedef stack_table_core<true> stack_global_table;
template <typename base_t>
struct basic_environment;
using environment = basic_environment<reference>;
using main_environment = basic_environment<main_reference>;
using stack_environment = basic_environment<stack_reference>;
template <typename T, bool>
class basic_function;
template <typename T, bool, typename H>
class basic_protected_function;
using unsafe_function = basic_function<reference, false>;
using safe_function = basic_protected_function<reference, false, reference>;
using main_unsafe_function = basic_function<main_reference, false>;
using main_safe_function = basic_protected_function<main_reference, false, reference>;
using stack_unsafe_function = basic_function<stack_reference, false>;
using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
using protected_function = safe_function;
using main_protected_function = main_safe_function;
using stack_protected_function = stack_safe_function;
using stack_aligned_protected_function = stack_aligned_safe_function;
#ifdef SOL_SAFE_FUNCTION
using function = protected_function;
using main_function = main_protected_function;
using stack_function = stack_protected_function;
#else
using function = unsafe_function;
using main_function = main_unsafe_function;
using stack_function = stack_unsafe_function;
#endif
using stack_aligned_function = stack_aligned_unsafe_function;
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
struct unsafe_function_result;
struct protected_function_result;
using safe_function_result = protected_function_result;
#ifdef SOL_SAFE_FUNCTION
using function_result = safe_function_result;
#else
using function_result = unsafe_function_result;
#endif
template <typename base_t>
class basic_object;
template <typename base_t>
class basic_userdata;
template <typename base_t>
class basic_lightuserdata;
template <typename base_t>
class basic_coroutine;
template <typename base_t>
class basic_thread;
using object = basic_object<reference>;
using userdata = basic_userdata<reference>;
using lightuserdata = basic_lightuserdata<reference>;
using thread = basic_thread<reference>;
using coroutine = basic_coroutine<reference>;
using main_object = basic_object<main_reference>;
using main_userdata = basic_userdata<main_reference>;
using main_lightuserdata = basic_lightuserdata<main_reference>;
using main_coroutine = basic_coroutine<main_reference>;
using stack_object = basic_object<stack_reference>;
using stack_userdata = basic_userdata<stack_reference>;
using stack_lightuserdata = basic_lightuserdata<stack_reference>;
using stack_thread = basic_thread<stack_reference>;
using stack_coroutine = basic_coroutine<stack_reference>;
struct stack_proxy_base;
struct stack_proxy;
struct variadic_args;
struct variadic_results;
struct stack_count;
struct this_state;
struct this_main_state;
struct this_environment;
template <typename T>
struct as_table_t;
template <typename T>
struct as_container_t;
template <typename T>
struct nested;
template <typename T>
struct light;
template <typename T>
struct user;
template <typename T>
struct as_args_t;
template <typename T>
struct protect_t;
template <typename F, typename... Filters>
struct filter_wrapper;
} // namespace sol
// end of sol/forward.hpp
#endif // SOL_SINGLE_INCLUDE_FORWARD_HPP

View File

@ -519,6 +519,7 @@ namespace sol {
> KV;
typedef typename KV::first_type K;
typedef typename KV::second_type V;
typedef std::conditional_t<is_matched_lookup::value, std::ptrdiff_t, K> next_K;
typedef decltype(*std::declval<iterator&>()) iterator_return;
typedef std::conditional_t<is_associative::value || is_matched_lookup::value,
std::add_lvalue_reference_t<V>,
@ -914,7 +915,7 @@ namespace sol {
}
static error_result insert_has(std::true_type, lua_State* L, T& self, stack_object key, stack_object value) {
return insert_lookup(meta::all<is_associative, is_lookup>(), L, self, std::move(key), std::move(value));
return insert_lookup(meta::any<is_associative, is_lookup>(), L, self, std::move(key), std::move(value));
}
static error_result insert_has(std::false_type, lua_State* L, T& self, stack_object where, stack_object value) {
@ -1057,21 +1058,12 @@ namespace sol {
return p;
}
template <bool ip>
static int pairs_associative(std::true_type, lua_State* L) {
auto& src = get_src(L);
stack::push(L, next<ip>);
stack::push<user<iter>>(L, src, deferred_traits::begin(L, src));
stack::push(L, lua_nil);
return 3;
}
template <bool>
static int next_associative(std::false_type, lua_State* L) {
iter& i = stack::get<user<iter>>(L, 1);
auto& source = i.source;
auto& it = i.it;
K k = stack::get<K>(L, 2);
next_K k = stack::get<next_K>(L, 2);
if (it == deferred_traits::end(L, source)) {
return 0;
}
@ -1082,6 +1074,21 @@ namespace sol {
return p;
}
template <bool ip>
static int next(lua_State* L) {
typedef meta::any<is_associative, meta::all<is_lookup, meta::neg<is_matched_lookup>>> is_assoc;
return next_associative<ip>(is_assoc(), L);
}
template <bool ip>
static int pairs_associative(std::true_type, lua_State* L) {
auto& src = get_src(L);
stack::push(L, next<ip>);
stack::push<user<iter>>(L, src, deferred_traits::begin(L, src));
stack::push(L, lua_nil);
return 3;
}
template <bool ip>
static int pairs_associative(std::false_type, lua_State* L) {
auto& src = get_src(L);
@ -1091,12 +1098,6 @@ namespace sol {
return 3;
}
template <bool ip>
static int next(lua_State* L) {
typedef meta::any<is_associative, meta::all<is_lookup, meta::neg<is_matched_lookup>>> is_assoc;
return next_associative<ip>(is_assoc(), L);
}
public:
static int get(lua_State* L) {
auto& self = get_src(L);

View File

@ -1,105 +1,105 @@
// sol2
// The MIT License (MIT)
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef SOL_INHERITANCE_HPP
#define SOL_INHERITANCE_HPP
#include "types.hpp"
namespace sol {
template <typename... Args>
struct base_list {};
template <typename... Args>
using bases = base_list<Args...>;
typedef bases<> base_classes_tag;
const auto base_classes = base_classes_tag();
namespace detail {
template <typename T>
struct has_derived {
static bool value;
};
template <typename T>
bool has_derived<T>::value = false;
inline decltype(auto) base_class_check_key() {
static const auto& key = "class_check";
return key;
}
inline decltype(auto) base_class_cast_key() {
static const auto& key = "class_cast";
return key;
}
inline decltype(auto) base_class_index_propogation_key() {
static const auto& key = u8"\xF0\x9F\x8C\xB2.index";
return key;
}
inline decltype(auto) base_class_new_index_propogation_key() {
static const auto& key = u8"\xF0\x9F\x8C\xB2.new_index";
return key;
}
template <typename T, typename... Bases>
struct inheritance {
static bool type_check_bases(types<>, const std::string&) {
return false;
}
template <typename Base, typename... Args>
static bool type_check_bases(types<Base, Args...>, const std::string& ti) {
return ti == usertype_traits<Base>::qualified_name() || type_check_bases(types<Args...>(), ti);
}
static bool type_check(const std::string& ti) {
return ti == usertype_traits<T>::qualified_name() || type_check_bases(types<Bases...>(), ti);
}
static void* type_cast_bases(types<>, T*, const std::string&) {
return nullptr;
}
template <typename Base, typename... Args>
static void* type_cast_bases(types<Base, Args...>, T* data, const std::string& ti) {
// Make sure to convert to T first, and then dynamic cast to the proper type
return ti != usertype_traits<Base>::qualified_name() ? type_cast_bases(types<Args...>(), data, ti) : static_cast<void*>(static_cast<Base*>(data));
}
static void* type_cast(void* voiddata, const std::string& ti) {
T* data = static_cast<T*>(voiddata);
return static_cast<void*>(ti != usertype_traits<T>::qualified_name() ? type_cast_bases(types<Bases...>(), data, ti) : data);
}
};
using inheritance_check_function = decltype(&inheritance<void>::type_check);
using inheritance_cast_function = decltype(&inheritance<void>::type_cast);
} // namespace detail
} // namespace sol
#endif // SOL_INHERITANCE_HPP
// sol2
// The MIT License (MIT)
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef SOL_INHERITANCE_HPP
#define SOL_INHERITANCE_HPP
#include "types.hpp"
namespace sol {
template <typename... Args>
struct base_list {};
template <typename... Args>
using bases = base_list<Args...>;
typedef bases<> base_classes_tag;
const auto base_classes = base_classes_tag();
namespace detail {
template <typename T>
struct has_derived {
static bool value;
};
template <typename T>
bool has_derived<T>::value = false;
inline decltype(auto) base_class_check_key() {
static const auto& key = "class_check";
return key;
}
inline decltype(auto) base_class_cast_key() {
static const auto& key = "class_cast";
return key;
}
inline decltype(auto) base_class_index_propogation_key() {
static const auto& key = u8"\xF0\x9F\x8C\xB2.index";
return key;
}
inline decltype(auto) base_class_new_index_propogation_key() {
static const auto& key = u8"\xF0\x9F\x8C\xB2.new_index";
return key;
}
template <typename T, typename... Bases>
struct inheritance {
static bool type_check_bases(types<>, const std::string&) {
return false;
}
template <typename Base, typename... Args>
static bool type_check_bases(types<Base, Args...>, const std::string& ti) {
return ti == usertype_traits<Base>::qualified_name() || type_check_bases(types<Args...>(), ti);
}
static bool type_check(const std::string& ti) {
return ti == usertype_traits<T>::qualified_name() || type_check_bases(types<Bases...>(), ti);
}
static void* type_cast_bases(types<>, T*, const std::string&) {
return nullptr;
}
template <typename Base, typename... Args>
static void* type_cast_bases(types<Base, Args...>, T* data, const std::string& ti) {
// Make sure to convert to T first, and then dynamic cast to the proper type
return ti != usertype_traits<Base>::qualified_name() ? type_cast_bases(types<Args...>(), data, ti) : static_cast<void*>(static_cast<Base*>(data));
}
static void* type_cast(void* voiddata, const std::string& ti) {
T* data = static_cast<T*>(voiddata);
return static_cast<void*>(ti != usertype_traits<T>::qualified_name() ? type_cast_bases(types<Bases...>(), data, ti) : data);
}
};
using inheritance_check_function = decltype(&inheritance<void>::type_check);
using inheritance_cast_function = decltype(&inheritance<void>::type_cast);
} // namespace detail
} // namespace sol
#endif // SOL_INHERITANCE_HPP

View File

@ -551,7 +551,7 @@ namespace sol {
struct is_lookup : meta::all<has_key_type<T>, has_value_type<T>> {};
template <typename T>
struct is_matched_lookup : meta_detail::is_matched_lookup_impl<T, meta::all<has_key_type<T>, has_value_type<T>>::value> {};
struct is_matched_lookup : meta_detail::is_matched_lookup_impl<T, is_lookup<T>::value> {};
template <typename T>
using is_string_constructible = any<

File diff suppressed because it is too large Load Diff

View File

@ -790,6 +790,16 @@ end
REQUIRE((v3 == 14));
}
template <typename T>
void lookup_container_check(sol::state& lua, T&) {
auto result0 = lua.safe_script("assert(c['a'] == 'a')", sol::script_default_on_error);
REQUIRE(result0.valid());
auto result1 = lua.safe_script("assert(c['b'] == 'b')", sol::script_default_on_error);
REQUIRE(result1.valid());
auto result2 = lua.safe_script("assert(c['c'] == 'c')", sol::script_default_on_error);
REQUIRE(result2.valid());
}
TEST_CASE("containers/sequence containers", "check all of the functinos for every single container") {
SECTION("vector") {
sol::state lua;
@ -869,6 +879,14 @@ TEST_CASE("containers/ordered lookup containers", "check ordered container types
lua["c"] = &items;
ordered_container_check(lua, items);
}
SECTION("set string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::set<std::string> items({ "a", "b", "c" });
lua["c"] = &items;
lookup_container_check(lua, items);
}
SECTION("multiset") {
sol::state lua;
lua.open_libraries(sol::lib::base);
@ -877,6 +895,14 @@ TEST_CASE("containers/ordered lookup containers", "check ordered container types
lua["c"] = &items;
ordered_container_check(lua, items);
}
SECTION("multiset string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::multiset<std::string> items({ "a", "b", "c" });
lua["c"] = &items;
lookup_container_check(lua, items);
}
}
TEST_CASE("containers/unordered lookup containers", "check ordered container types") {
@ -888,6 +914,14 @@ TEST_CASE("containers/unordered lookup containers", "check ordered container typ
lua["c"] = &items;
unordered_container_check(lua, items);
}
SECTION("unordered_set string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::unordered_set<std::string> items({ "a", "b", "c" });
lua["c"] = &items;
lookup_container_check(lua, items);
}
SECTION("unordered_multiset") {
sol::state lua;
lua.open_libraries(sol::lib::base);
@ -896,6 +930,14 @@ TEST_CASE("containers/unordered lookup containers", "check ordered container typ
lua["c"] = &items;
unordered_container_check(lua, items);
}
SECTION("unordered_multiset string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::unordered_multiset<std::string> items({ "a", "b", "c" });
lua["c"] = &items;
lookup_container_check(lua, items);
}
}
TEST_CASE("containers/associative ordered containers", "check associative (map) containers that are ordered fulfill basic functionality requirements") {
@ -913,6 +955,18 @@ TEST_CASE("containers/associative ordered containers", "check associative (map)
lua["c"] = &items;
associative_ordered_container_check(lua, items);
}
SECTION("map string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::map<std::string, std::string> items{
{ "a", "a" },
{ "b", "b" },
{ "c", "c" }
};
lua["c"] = &items;
lookup_container_check(lua, items);
}
SECTION("multimap") {
sol::state lua;
lua.open_libraries(sol::lib::base);
@ -927,6 +981,18 @@ TEST_CASE("containers/associative ordered containers", "check associative (map)
lua["c"] = &items;
associative_ordered_container_check(lua, items);
}
SECTION("multimap string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::multimap<std::string, std::string> items{
{ "a", "a" },
{ "b", "b" },
{ "c", "c" }
};
lua["c"] = &items;
lookup_container_check(lua, items);
}
}
TEST_CASE("containers/associative unordered containers", "check associative (map) containers that are ordered that they fulfill basic functionality requirements") {
@ -944,6 +1010,18 @@ TEST_CASE("containers/associative unordered containers", "check associative (map
lua["c"] = &items;
associative_unordered_container_check(lua, items);
}
SECTION("unordered_map string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::unordered_map<std::string, std::string> items{
{ "a", "a" },
{ "b", "b" },
{ "c", "c" }
};
lua["c"] = &items;
lookup_container_check(lua, items);
}
SECTION("unordered_multimap") {
sol::state lua;
lua.open_libraries(sol::lib::base);
@ -958,6 +1036,18 @@ TEST_CASE("containers/associative unordered containers", "check associative (map
lua["c"] = &items;
associative_unordered_container_check(lua, items);
}
SECTION("unordered_multimap string") {
sol::state lua;
lua.open_libraries(sol::lib::base);
std::unordered_multimap<std::string, std::string> items{
{ "a", "a" },
{ "b", "b" },
{ "c", "c" }
};
lua["c"] = &items;
lookup_container_check(lua, items);
}
}
TEST_CASE("containers/associative ordered pairs", "check to make sure pairs works properly for key-value types") {