Add unit test for #302

This commit is contained in:
Jason Turner
2016-12-06 14:22:12 -07:00
parent cf89bdd804
commit 624c7c435b

View File

@@ -1186,3 +1186,16 @@ TEST_CASE("Test typed chaiscript functions to perform conversions")
)"); )");
} }
struct Reference_MyClass
{
Reference_MyClass(double& t_x) : x(t_x) {}
double& x;
};
TEST_CASE("Test reference member being registered")
{
chaiscript::ChaiScript_Basic chai(create_chaiscript_stdlib(),create_chaiscript_parser());
chai.add(chaiscript::fun(&Reference_MyClass::x) , "x");
}