15 lines
368 B
C++
15 lines
368 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() == u"b");
|
|
delete script;
|
|
}
|
|
|
|
#endif
|