mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Fix formatting on tests file
This commit is contained in:
parent
63bc2b06cb
commit
b6c2f1c6d5
24
tests.cpp
24
tests.cpp
|
@ -8,24 +8,17 @@ std::string free_function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct object {
|
struct object {
|
||||||
|
|
||||||
std::string operator() () {
|
std::string operator() () {
|
||||||
std::cout << "member_test()" << std::endl;
|
std::cout << "member_test()" << std::endl;
|
||||||
return "test";
|
return "test";
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fuser {
|
struct fuser {
|
||||||
int x;
|
int x;
|
||||||
|
fuser() : x(0) {}
|
||||||
|
|
||||||
fuser( ) : x( 0 ) {
|
fuser(int x) : x(x) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fuser( int x ) : x( x ) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int add(int y) {
|
int add(int y) {
|
||||||
return x + y;
|
return x + y;
|
||||||
|
@ -39,12 +32,10 @@ struct fuser {
|
||||||
namespace crapola {
|
namespace crapola {
|
||||||
struct fuser {
|
struct fuser {
|
||||||
int x;
|
int x;
|
||||||
fuser( ) : x( 0 ) {
|
fuser() : x(0) {}
|
||||||
}
|
fuser(int x) : x(x) {}
|
||||||
fuser( int x ) : x( x ) {
|
fuser(int x, int x2) : x(x * x2) {}
|
||||||
}
|
|
||||||
fuser( int x, int x2 ) : x( x * x2 ) {
|
|
||||||
}
|
|
||||||
int add(int y) {
|
int add(int y) {
|
||||||
return x + y;
|
return x + y;
|
||||||
}
|
}
|
||||||
|
@ -407,8 +398,7 @@ TEST_CASE("tables/userdata constructors", "Show that we can create classes from
|
||||||
"x = b:add2(1)\n"
|
"x = b:add2(1)\n"
|
||||||
"c = crapola_fuser.new(2, 3)\n"
|
"c = crapola_fuser.new(2, 3)\n"
|
||||||
"y = c:add(1)\n"
|
"y = c:add(1)\n"
|
||||||
"z = c:add2(1)\n"
|
"z = c:add2(1)\n");
|
||||||
);
|
|
||||||
sol::object a = lua.get<sol::object>("a");
|
sol::object a = lua.get<sol::object>("a");
|
||||||
auto atype = a.get_type();
|
auto atype = a.get_type();
|
||||||
REQUIRE((atype == sol::type::userdata));
|
REQUIRE((atype == sol::type::userdata));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user