Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JBenda committed Apr 20, 2024
1 parent 5077085 commit dcad4c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions inkcpp/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void basic_stream::append(const value& in)
if ((in.type() == value_type::glue || in.type() == value_type::func_end) && _size > 1) {
// Run backwards
size_t i = _size - 2;
int func_end_cnt = 0;
int func_end_cnt = 0;
while (true) {
value& d = _data[i];

Expand All @@ -78,9 +78,9 @@ void basic_stream::append(const value& in)
else if (d.type() == value_type::string && ::ink::internal::is_whitespace(d.get<value_type::string>()))
d = value{};
else if (d.type() == value_type::func_end) {
func_end_cnt ++;
++func_end_cnt;
} else if (d.type() == value_type::func_start && func_end_cnt > 0) {
func_end_cnt --;
--func_end_cnt;
}

// If it's not a newline or whitespace, stop
Expand Down
14 changes: 7 additions & 7 deletions inkcpp_test/NewLines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ SCENARIO("a story has the proper line breaks", "[lines]")
}
}
}
GIVEN("a complex story") {
auto ink = story::from_file(INK_TEST_RESOURCE_DIR "TheIntercept.bin");
GIVEN("a complex story")
{
auto ink = story::from_file(INK_TEST_RESOURCE_DIR "TheIntercept.bin");
runner thread = ink->new_runner();
// based on issue #82
WHEN("run sequence 1 3 3 3 2 3") {
for(int i : {1, 3, 3, 3, 2, 3}) {
WHEN("run sequence 1 3 3 3 2 3")
{
for (int i : {1, 3, 3, 3, 2, 3}) {
thread->getall();
thread->choose(i - 1);
}
std::string text = thread->getall();
THEN("no newline before dot"){
REQUIRE(text == "\"I don't see why,\" I reply.\n");
}
THEN("no newline before dot") { REQUIRE(text == "\"I don't see why,\" I reply.\n"); }
}
}
}

0 comments on commit dcad4c7

Please sign in to comment.