26 lines
632 B
C++
26 lines
632 B
C++
|
|
#ifdef TESTS_BUILD
|
|
#include <catch.hpp>
|
|
#include "../src/Script.hpp"
|
|
|
|
|
|
TEST_CASE( "Simple String", "[integration]" ) {
|
|
Script script = Script::Create("\"foo bar\"");
|
|
REQUIRE(!script.Diagnostics -> HasErrors());
|
|
script.Evaluate();
|
|
auto lastValue = script.GetLastValue();
|
|
REQUIRE(lastValue->EvaluateString() == "foo bar");
|
|
}
|
|
|
|
TEST_CASE( "String Concat", "[integration]" ) {
|
|
Script script = Script::Create("\"foo\" + \"bar\"");
|
|
REQUIRE(!script.Diagnostics -> HasErrors());
|
|
script.Evaluate();
|
|
auto lastValue = script.GetLastValue();
|
|
REQUIRE(lastValue->EvaluateString() == "foobar");
|
|
}
|
|
|
|
|
|
#endif
|
|
|