15 lines
367 B
C++
15 lines
367 B
C++
#ifdef TESTS_BUILD
|
|
#include <catch.hpp>
|
|
#include "../src/Script.hpp"
|
|
|
|
TEST_CASE( "String indexing", "[integration]" ) {
|
|
auto script = Script::Create("'foobar'[4]");
|
|
REQUIRE(!script->Diagnostics -> HasErrors());
|
|
script->Evaluate();
|
|
auto lastValue = script->GetLastValue();
|
|
REQUIRE(*lastValue->EvaluateString() == "b");
|
|
delete script;
|
|
}
|
|
|
|
#endif
|