Fixes for return statement, make Evaluate function on script return value
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
@@ -34,11 +34,10 @@ TEST_CASE( "Index string table", "[integration]" ) {
|
||||
Script* script = Script::Create(
|
||||
R"(
|
||||
table = {'bla', 'test', 'foo', 'bar'}
|
||||
result = table[3]
|
||||
return table[3]
|
||||
)");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
script->Evaluate();
|
||||
auto variable = script->GetVariable("result");
|
||||
auto variable = script->Evaluate();
|
||||
REQUIRE(variable != nullptr);
|
||||
REQUIRE(*variable->EvaluateString() == "foo");
|
||||
delete script;
|
||||
@@ -71,11 +70,10 @@ table = {
|
||||
return foo
|
||||
end
|
||||
}
|
||||
result = table["getFoo"]()
|
||||
return table["getFoo"]()
|
||||
)");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
script->Evaluate();
|
||||
auto variable = script->GetVariable("result");
|
||||
auto variable = script->Evaluate();
|
||||
REQUIRE(variable != nullptr);
|
||||
delete script;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user