Fix Tree String tests
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
30d82085cc
commit
326a3c097a
|
@ -46,7 +46,7 @@ TEST_CASE( "Assignment Statement To String", "[BoundTreeString]" ) {
|
|||
const BoundVariableKey *keyObj = new BoundVariableKey(HashedString(key), 0, true, ScriptType::NilType);
|
||||
auto s = new BoundAssignmentStatement(keyObj, new BoundLiteralIntegerExpression(5, 0,0));
|
||||
s->GetTreeString(stream, 1);
|
||||
REQUIRE(stream.str() == "\tAssignment -> global key\n\t\tLiteralInteger: 5 (number)");
|
||||
REQUIRE(stream.str() == "\tAssignment -> global key\n\t\tLiteralInteger: 5 (numeric (Known integer))");
|
||||
delete s;
|
||||
}
|
||||
|
||||
|
@ -102,11 +102,11 @@ TEST_CASE( "Numerical For to String", "[BoundTreeString]" ) {
|
|||
REQUIRE(stream.str() ==
|
||||
R"( NumericForLoopStatement
|
||||
Start:
|
||||
LiteralInteger: 0 (number)
|
||||
LiteralInteger: 0 (numeric (Known integer))
|
||||
End:
|
||||
LiteralInteger: 5 (number)
|
||||
LiteralInteger: 5 (numeric (Known integer))
|
||||
Step:
|
||||
LiteralInteger: 1 (number)
|
||||
LiteralInteger: 1 (numeric (Known integer))
|
||||
Do:
|
||||
BadStatement)");
|
||||
delete s;
|
||||
|
@ -122,8 +122,8 @@ TEST_CASE( "Generic For to String", "[BoundTreeString]" ) {
|
|||
s->GetTreeString(stream, 1);
|
||||
REQUIRE(stream.str() ==
|
||||
R"( GenericForLoopStatement
|
||||
Key: k (number)
|
||||
Value: v (number)
|
||||
Key: k (numeric (Known integer))
|
||||
Value: v (numeric (Known integer))
|
||||
Iterator:
|
||||
NilExpression (nil)
|
||||
Do:
|
||||
|
@ -173,7 +173,7 @@ TEST_CASE( "Literal Integer Expression To String", "[BoundTreeString]" ) {
|
|||
std::stringstream stream;
|
||||
auto s = new BoundLiteralIntegerExpression(684,0,0);
|
||||
s->GetTreeString(stream, 1);
|
||||
REQUIRE(stream.str() == "\tLiteralInteger: 684 (number)");
|
||||
REQUIRE(stream.str() == "\tLiteralInteger: 684 (numeric (Known integer))");
|
||||
delete s;
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ TEST_CASE( "Literal Float Expression To String", "[BoundTreeString]" ) {
|
|||
std::stringstream stream;
|
||||
auto s = new BoundLiteralFloatExpression(5.5,0,0);
|
||||
s->GetTreeString(stream, 1);
|
||||
REQUIRE(stream.str() == "\tLiteralFloat: 5.5 (number)");
|
||||
REQUIRE(stream.str() == "\tLiteralFloat: 5.5 (numeric (Known float))");
|
||||
delete s;
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ TEST_CASE( "Binary Expression To String", "[BoundTreeString]" ) {
|
|||
NumericScriptType::AwareInt, 0,0
|
||||
);
|
||||
s->GetTreeString(stream, 1);
|
||||
REQUIRE(stream.str() == "\tBinaryExpression: addition (number)\n\t\tLiteralInteger: 5 (number)\n\t\tLiteralInteger: 200 (number)");
|
||||
REQUIRE(stream.str() == "\tBinaryExpression: addition (numeric (Known integer))\n\t\tLiteralInteger: 5 (numeric (Known integer))\n\t\tLiteralInteger: 200 (numeric (Known integer))");
|
||||
delete s;
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ TEST_CASE( "Unary Expression To String", "[BoundTreeString]" ) {
|
|||
NumericScriptType::AwareInt, 0,0
|
||||
);
|
||||
s->GetTreeString(stream, 1);
|
||||
REQUIRE(stream.str() == "\tUnaryExpression: negation (number)\n\t\tLiteralInteger: 5 (number)");
|
||||
REQUIRE(stream.str() == "\tUnaryExpression: negation (numeric (Known integer))\n\t\tLiteralInteger: 5 (numeric (Known integer))");
|
||||
delete s;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@ TEST_CASE( "Basic script to bound tree string", "[integration]" ) {
|
|||
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)");
|
||||
"\t\tBinaryExpression: addition (numeric (Known integer))\n"
|
||||
"\t\t\tLiteralInteger: 10 (numeric (Known integer))\n"
|
||||
"\t\t\tLiteralInteger: 500 (numeric (Known integer))");
|
||||
delete script;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue