PorygonLang/tests/integration/numerical_operations_tests.cpp

13 lines
336 B
C++
Raw Normal View History

2019-05-23 16:50:09 +00:00
#ifdef TESTS_BUILD
#include <catch.hpp>
#include "../src/Script.hpp"
TEST_CASE( "Simple addition", "[integration]" ) {
Script script = Script::Create("1 + 5");
REQUIRE(!script.Diagnostics -> HasErrors());
script.Evaluate();
auto lastValue = script.GetLastValue();
REQUIRE(*any_cast<long>(lastValue) == 6);
}
#endif