Work on evaluation
This commit is contained in:
12
tests/integration/numerical_operations_tests.cpp
Normal file
12
tests/integration/numerical_operations_tests.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user