mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Fixed tests spacing
This commit is contained in:
parent
d548fdaee8
commit
5930818891
|
@ -671,6 +671,7 @@ TEST_CASE("userdata/issue-number-thirty-five", "using value types created from l
|
||||||
float length() {
|
float length() {
|
||||||
return sqrtf(x*x + y*y + z*z);
|
return sqrtf(x*x + y*y + z*z);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vec normalized() {
|
Vec normalized() {
|
||||||
float invS = 1 / length();
|
float invS = 1 / length();
|
||||||
return {x * invS, y * invS, z * invS};
|
return {x * invS, y * invS, z * invS};
|
||||||
|
@ -693,9 +694,7 @@ TEST_CASE("userdata/issue-number-thirty-five", "using value types created from l
|
||||||
lua.set_userdata(ludata);
|
lua.set_userdata(ludata);
|
||||||
|
|
||||||
sol::constructors<sol::types<float, float, float>> ctor;
|
sol::constructors<sol::types<float, float, float>> ctor;
|
||||||
sol::userdata<Vec> udata("Vec", ctor,
|
sol::userdata<Vec> udata("Vec", ctor, "normalized", &Vec::normalized, "length", &Vec::length);
|
||||||
"normalized", &Vec::normalized,
|
|
||||||
"length", &Vec::length);
|
|
||||||
|
|
||||||
lua.set_userdata(udata);
|
lua.set_userdata(udata);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user