Skip to content

Commit

Permalink
[wip] re #288: add test reproducing
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Aug 1, 2022
1 parent d44a9b9 commit 8da7d6e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,21 @@ TEST(Tree, reserve)
test_invariants(t);
}

// https://github.com/biojppm/rapidyaml/issues/288
TEST(Tree, reserve_issue288)
{
Tree t;
t.reserve_arena(3);
// longer than the slack to cause another call to _grow_arena()
size_t slack = t.arena_slack();
std::string large(2 * slack, '*');
t.copy_to_arena(to_csubstr(large));
// again
slack = t.arena_slack();
large.assign(2 * slack, '+');
t.copy_to_arena(to_csubstr(large));
}

TEST(Tree, clear)
{
Tree t(16, 64);
Expand Down

0 comments on commit 8da7d6e

Please sign in to comment.