Add failing test for functor scope

This commit is contained in:
Jason Turner 2015-08-25 17:10:45 -06:00
parent 28f5a74e98
commit 179eaefafe

View File

@ -776,4 +776,12 @@ TEST_CASE("Variable Scope When Calling From C++")
CHECK_THROWS(func());
}
TEST_CASE("Variable Scope When Calling From C++ 2")
{
chaiscript::ChaiScript chai;
chai.eval("var obj = 2;");
auto func = chai.eval<std::function<void()>>("fun(){ return obj; }");
CHECK_THROWS(func());
}