Delete script after tests
This commit is contained in:
parent
f6cf4d96dd
commit
3c0df2e615
|
@ -11,6 +11,7 @@ TEST_CASE( "Diagnostic invalid character", "[integration]" ) {
|
|||
CHECK(diags[0].GetCode() == DiagnosticCode::UnexpectedCharacter);
|
||||
CHECK(diags[0].GetStartPosition() == 6);
|
||||
CHECK(diags[0].GetLength() == 1);
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "Diagnostic invalid token", "[integration]" ) {
|
||||
|
@ -21,6 +22,7 @@ TEST_CASE( "Diagnostic invalid token", "[integration]" ) {
|
|||
CHECK(diags[0].GetCode() == DiagnosticCode::UnexpectedToken);
|
||||
CHECK(diags[0].GetStartPosition() == 3);
|
||||
CHECK(diags[0].GetLength() == 1);
|
||||
delete script;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ TEST_CASE( "True Equals True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "True Not Equals True", "[integration]" ) {
|
||||
auto script = Script::Create("true == false");
|
||||
|
@ -16,6 +17,7 @@ TEST_CASE( "True Not Equals True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "True Nequals False", "[integration]" ) {
|
||||
auto script = Script::Create("true ~= false");
|
||||
|
@ -23,6 +25,7 @@ TEST_CASE( "True Nequals False", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "True Not Nequals True", "[integration]" ) {
|
||||
auto script = Script::Create("true ~= true");
|
||||
|
@ -30,6 +33,7 @@ TEST_CASE( "True Not Nequals True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,6 +43,7 @@ TEST_CASE( "False Equals False", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "10 Equals 10", "[integration]" ) {
|
||||
|
@ -47,6 +52,7 @@ TEST_CASE( "10 Equals 10", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "10 Not Equals 5", "[integration]" ) {
|
||||
auto script = Script::Create("10 == 5");
|
||||
|
@ -54,6 +60,7 @@ TEST_CASE( "10 Not Equals 5", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ TEST_CASE( "Basic True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "Basic False", "[integration]" ) {
|
||||
|
@ -16,6 +17,7 @@ TEST_CASE( "Basic False", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "True and True", "[integration]" ) {
|
||||
|
@ -24,6 +26,7 @@ TEST_CASE( "True and True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "True and False", "[integration]" ) {
|
||||
auto script = Script::Create("true and false");
|
||||
|
@ -31,6 +34,7 @@ TEST_CASE( "True and False", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "False and True", "[integration]" ) {
|
||||
auto script = Script::Create("false and true");
|
||||
|
@ -38,6 +42,7 @@ TEST_CASE( "False and True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "False and False", "[integration]" ) {
|
||||
auto script = Script::Create("false and false");
|
||||
|
@ -45,6 +50,7 @@ TEST_CASE( "False and False", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "True or True", "[integration]" ) {
|
||||
|
@ -53,6 +59,7 @@ TEST_CASE( "True or True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "True or False", "[integration]" ) {
|
||||
auto script = Script::Create("true or false");
|
||||
|
@ -67,6 +74,7 @@ TEST_CASE( "False or True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "False or False", "[integration]" ) {
|
||||
auto script = Script::Create("false or false");
|
||||
|
@ -74,6 +82,7 @@ TEST_CASE( "False or False", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "Not True", "[integration]" ) {
|
||||
|
@ -82,6 +91,7 @@ TEST_CASE( "Not True", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(!lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "Not False", "[integration]" ) {
|
||||
|
@ -90,6 +100,7 @@ TEST_CASE( "Not False", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateBool());
|
||||
delete script;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,6 +8,7 @@ TEST_CASE( "Integer Negation", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateInteger() == -60);
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "Float Negation", "[integration]" ) {
|
||||
auto script = Script::Create("-5.65");
|
||||
|
@ -15,6 +16,7 @@ TEST_CASE( "Float Negation", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateFloat() == Approx(-5.65));
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "Integer Addition", "[integration]" ) {
|
||||
|
@ -23,6 +25,7 @@ TEST_CASE( "Integer Addition", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateInteger() == 6);
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "Integer Subtraction", "[integration]" ) {
|
||||
auto script = Script::Create("1 - 5");
|
||||
|
@ -37,6 +40,7 @@ TEST_CASE( "Integer Multiplication", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateInteger() == 40);
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "Integer Division", "[integration]" ) {
|
||||
auto script = Script::Create("40 / 8");
|
||||
|
@ -44,6 +48,7 @@ TEST_CASE( "Integer Division", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateInteger() == 5);
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "Float Addition", "[integration]" ) {
|
||||
|
@ -52,6 +57,7 @@ TEST_CASE( "Float Addition", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateFloat() == 6.54);
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "Float Subtraction", "[integration]" ) {
|
||||
auto script = Script::Create("1.8 - 5.14");
|
||||
|
@ -59,6 +65,7 @@ TEST_CASE( "Float Subtraction", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateFloat() == -3.34);
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "Float Multiplication", "[integration]" ) {
|
||||
auto script = Script::Create("5.2 * 8.9");
|
||||
|
@ -66,6 +73,7 @@ TEST_CASE( "Float Multiplication", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateFloat() == 46.28);
|
||||
delete script;
|
||||
}
|
||||
TEST_CASE( "Float Division", "[integration]" ) {
|
||||
auto script = Script::Create("95.18 / 8.87");
|
||||
|
@ -73,5 +81,6 @@ TEST_CASE( "Float Division", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateFloat() == Approx(10.7305524239));
|
||||
delete script;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -10,6 +10,7 @@ TEST_CASE( "Simple String", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateString() == "foo bar");
|
||||
delete script;
|
||||
}
|
||||
|
||||
TEST_CASE( "String Concat", "[integration]" ) {
|
||||
|
@ -18,6 +19,7 @@ TEST_CASE( "String Concat", "[integration]" ) {
|
|||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
REQUIRE(lastValue->EvaluateString() == "foobar");
|
||||
delete script;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue