From 326a3c097a84db8830e217457a3c58108470d233 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 22 Sep 2019 17:41:18 +0200 Subject: [PATCH] Fix Tree String tests --- tests/TreeStringTests.cpp | 20 ++++++++++---------- tests/integration/BoundTreeStringTests.cpp | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/TreeStringTests.cpp b/tests/TreeStringTests.cpp index c4d4ba6..31d4417 100644 --- a/tests/TreeStringTests.cpp +++ b/tests/TreeStringTests.cpp @@ -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; } diff --git a/tests/integration/BoundTreeStringTests.cpp b/tests/integration/BoundTreeStringTests.cpp index 60f464d..8fa195c 100644 --- a/tests/integration/BoundTreeStringTests.cpp +++ b/tests/integration/BoundTreeStringTests.cpp @@ -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; }