-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathThirdTierChoiceAfterBrackets.cpp
More file actions
39 lines (35 loc) · 913 Bytes
/
ThirdTierChoiceAfterBrackets.cpp
File metadata and controls
39 lines (35 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#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")
{
std::unique_ptr<story> 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());
}
}
}
}