Sha256: edb39e3d4c8d4a236098babd1a4c867867ffae91155f7b58f6f60137e4fbaffc

Contents?: true

Size: 839 Bytes

Versions: 4

Compression:

Stored size: 839 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 a bracketed choice as a second choice, and then a third choice, chooses properly",
    "[choices]"
)
{
	GIVEN("a story with brackets and nested choices")
	{
		auto   ink    = story::from_file(INK_TEST_RESOURCE_DIR "ThirdTierChoiceAfterBracketsStory.bin");
		runner thread = ink->new_runner();

		WHEN("start thread")
		{
			THEN("thread doesn't error")
			{
				thread->getall();
				REQUIRE(thread->has_choices());
				thread->choose(0);
				thread->getall();
				REQUIRE(thread->has_choices());
				thread->choose(0);
				thread->getall();
				REQUIRE(thread->has_choices());
				thread->choose(0);
				thread->getall();
				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/ThirdTierChoiceAfterBrackets.cpp
inkcpp_rb-0.1.2 ext/inkcpp_rb/inkcpp/inkcpp_test/ThirdTierChoiceAfterBrackets.cpp
inkcpp_rb-0.1.1 ext/inkcpp_rb/inkcpp/inkcpp_test/ThirdTierChoiceAfterBrackets.cpp
inkcpp_rb-0.1.0 ext/inkcpp_rb/inkcpp/inkcpp_test/ThirdTierChoiceAfterBrackets.cpp