#ifdef TESTS_BUILD
#include <catch.hpp>
#include "../src/Script.hpp"
using namespace Porygon;

TEST_CASE( "Basic True", "[integration]" ) {
    auto script = Script::Create("true");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(result->EvaluateBool());
    delete script;
}

TEST_CASE( "Basic False", "[integration]" ) {
    auto script = Script::Create("false");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(!result->EvaluateBool());
    delete script;
}

TEST_CASE( "True and True", "[integration]" ) {
    auto script = Script::Create("true and true");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(result->EvaluateBool());
    delete script;
}
TEST_CASE( "True and False", "[integration]" ) {
    auto script = Script::Create("true and false");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(!result->EvaluateBool());
    delete script;
}
TEST_CASE( "False and True", "[integration]" ) {
    auto script = Script::Create("false and true");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(!result->EvaluateBool());
    delete script;
}
TEST_CASE( "False and False", "[integration]" ) {
    auto script = Script::Create("false and false");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(!result->EvaluateBool());
    delete script;
}

TEST_CASE( "True or True", "[integration]" ) {
    auto script = Script::Create("true or true");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(result->EvaluateBool());
    delete script;
}
TEST_CASE( "True or False", "[integration]" ) {
    auto script = Script::Create("true or false");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(result->EvaluateBool());
    delete script;
}
TEST_CASE( "False or True", "[integration]" ) {
    auto script = Script::Create("false or true");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(result->EvaluateBool());
    delete script;
}
TEST_CASE( "False or False", "[integration]" ) {
    auto script = Script::Create("false or false");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(!result->EvaluateBool());
    delete script;
}

TEST_CASE( "Not True", "[integration]" ) {
    auto script = Script::Create("not true");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(!result->EvaluateBool());
    delete script;
}

TEST_CASE( "Not False", "[integration]" ) {
    auto script = Script::Create("not false");
    REQUIRE(!script->Diagnostics -> HasErrors());
    auto result = script->Evaluate();
    REQUIRE(result->EvaluateBool());
    delete script;
}

#endif

