Removed LastValue variable, as it can be better emulated with basic return values

This commit is contained in:
2019-07-27 10:51:24 +02:00
parent 8b80b5789d
commit 268f6b59fb
10 changed files with 111 additions and 161 deletions

View File

@@ -63,11 +63,10 @@ TEST_CASE( "Evaluate String", "[integration]" ) {
auto sc = new u16string(u"\"foo bar\"");
auto script = Porygon::Script::Create(*sc);
REQUIRE(!script->Diagnostics -> HasErrors());
script->Evaluate();
auto lastValue = script->GetLastValue();
size_t size = GetEvalValueStringLength(lastValue);
auto result = script->Evaluate();
size_t size = GetEvalValueStringLength(result.get());
auto dst = new char16_t[size + 1]{'\0'};
EvaluateEvalValueString(lastValue, dst, size);
EvaluateEvalValueString(result.get(), dst, size);
auto s = u16string(dst);
REQUIRE(s == u"foo bar");
delete[] dst;