Work to add C style entry points to library that allow most functionality
This commit is contained in:
3
tests/integration/ExternFunctionsTests.cpp
Normal file
3
tests/integration/ExternFunctionsTests.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
|
||||
@@ -9,16 +9,25 @@ TEST_CASE( "Simple String", "[integration]" ) {
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateString() == "foo bar");
|
||||
REQUIRE(*lastValue->EvaluateString() == "foo bar");
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "String Concat", "[integration]" ) {
|
||||
auto script = Script::Create("\"foo\" + \"bar\"");
|
||||
auto script = Script::Create(R"("foo" + "bar")");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateString() == "foobar");
|
||||
REQUIRE(*lastValue->EvaluateString() == "foobar");
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "String Concat 2", "[integration]" ) {
|
||||
auto script = Script::Create("'foo' + 'bar'");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(*lastValue->EvaluateString() == "foobar");
|
||||
delete script;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user