Sha256: 72764eca512735d9935031ddfd6bfba93a8eb2cb1e60f4f22c1d7978868b73f9

Contents?: true

Size: 884 Bytes

Versions: 4

Compression:

Stored size: 884 Bytes

Contents

#include "catch.hpp"

#include <story.h>
#include <globals.h>
#include <runner.h>
#include <compiler.h>

using namespace ink::runtime;

SCENARIO("a story with bracketed choices and spaces can choose correctly", "[choices]")
{
	GIVEN("a story with line breaks")
	{
		auto   ink    = story::from_file(INK_TEST_RESOURCE_DIR "ChoiceBracketStory.bin");
		runner thread = ink->new_runner();
		thread->getall();
		WHEN("start thread")
		{
			THEN("thread has choices")
			{
				thread->getall();
				REQUIRE(thread->has_choices());
			}
			WHEN("choose choice 1")
			{
				thread->choose(0);
				thread->getall();
				THEN("still has choices")
				{
					thread->getall();
					REQUIRE(thread->has_choices());
				}
			}
			WHEN("choose choice 2")
			{
				thread->choose(1);
				thread->getall();
				THEN("still has choices")
				{
					REQUIRE(thread->has_choices());
				}
			}
		}
	}
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inkcpp_rb-0.1.3 ext/inkcpp_rb/inkcpp/inkcpp_test/SpaceAfterBracketChoice.cpp
inkcpp_rb-0.1.2 ext/inkcpp_rb/inkcpp/inkcpp_test/SpaceAfterBracketChoice.cpp
inkcpp_rb-0.1.1 ext/inkcpp_rb/inkcpp/inkcpp_test/SpaceAfterBracketChoice.cpp
inkcpp_rb-0.1.0 ext/inkcpp_rb/inkcpp/inkcpp_test/SpaceAfterBracketChoice.cpp