-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathSpaceAfterBracketChoice.cpp
More file actions
42 lines (39 loc) · 899 Bytes
/
SpaceAfterBracketChoice.cpp
File metadata and controls
42 lines (39 loc) · 899 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
40
41
42
#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")
{
std::unique_ptr<story> 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()); }
}
}
}
}