Work on evaluation

This commit is contained in:
2019-05-23 18:50:09 +02:00
parent 57cd3efec9
commit d949d9aa8f
10 changed files with 283 additions and 4 deletions

View 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