#ifdef TESTS_BUILD #include #include "../src/Script.hpp" #include "../../src/ScriptOptions.hpp" #include using namespace Porygon; TEST_CASE( "Abs positive returns positive", "[integration]" ) { Script* script = Script::Create(u"return math.abs(684)"); REQUIRE(!script->Diagnostics -> HasErrors()); auto result = script -> Evaluate(); CHECK(result->EvaluateInteger() == 684); delete script; } TEST_CASE( "Abs negative returns positive", "[integration]" ) { Script* script = Script::Create(u"return math.abs(-684)"); REQUIRE(!script->Diagnostics -> HasErrors()); auto result = script -> Evaluate(); CHECK(result->EvaluateInteger() == 684); delete script; } #endif