Support for retrieving bound tree string from script objecsts
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
20
tests/integration/BoundTreeStringTests.cpp
Normal file
20
tests/integration/BoundTreeStringTests.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "../src/Script.hpp"
|
||||
|
||||
using namespace Porygon;
|
||||
|
||||
TEST_CASE( "Basic script to bound tree string", "[integration]" ) {
|
||||
Script* script = Script::Create("return 10 + 500");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
auto boundTreeString = script->GetTreeString();
|
||||
REQUIRE(boundTreeString == "BlockStatement\n"
|
||||
"\tReturnStatement\n"
|
||||
"\t\tBinaryExpression: addition (number)\n"
|
||||
"\t\t\tLiteralInteger: 10 (number)\n"
|
||||
"\t\t\tLiteralInteger: 500 (number)");
|
||||
delete script;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user