2019-05-25 14:15:20 +00:00
|
|
|
|
|
|
|
#ifdef TESTS_BUILD
|
|
|
|
#include <catch.hpp>
|
|
|
|
#include "../src/Script.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
TEST_CASE( "Simple String", "[integration]" ) {
|
2019-05-28 15:49:03 +00:00
|
|
|
auto script = Script::Create("\"foo bar\"");
|
|
|
|
REQUIRE(!script->Diagnostics -> HasErrors());
|
|
|
|
script->Evaluate();
|
|
|
|
auto lastValue = script->GetLastValue();
|
2019-05-25 14:15:20 +00:00
|
|
|
REQUIRE(lastValue->EvaluateString() == "foo bar");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE( "String Concat", "[integration]" ) {
|
2019-05-28 15:49:03 +00:00
|
|
|
auto script = Script::Create("\"foo\" + \"bar\"");
|
|
|
|
REQUIRE(!script->Diagnostics -> HasErrors());
|
|
|
|
script->Evaluate();
|
|
|
|
auto lastValue = script->GetLastValue();
|
2019-05-25 14:15:20 +00:00
|
|
|
REQUIRE(lastValue->EvaluateString() == "foobar");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|