Skip to content

Commit

Permalink
Added test for larger strings
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Mar 2, 2024
1 parent 14ef4f0 commit fcc0126
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,18 @@ public void GivenStringBuilder_WhenAddingSingleCharacter_ThenShouldBeAdded()

builder.ToString().Should().Be("c");
}

[Fact]
public void GivenStringBuilder_WhenAddingIncreasinglyLargerStrings_ThenShouldBeAdded()
{
using var builder = new ValueStringBuilder();
builder.Append(new string('a', 256));
builder.Append(new string('b', 512));
builder.Append(new string('c', 1024));
builder.Append(new string('d', 2048));
builder.Append(new string('e', 4096));
builder.Append(new string('f', 8192));

builder.ToString().Should().MatchRegex("[a]{256}[b]{512}[c]{1024}[d]{2048}[e]{4096}[f]{8192}");
}
}

0 comments on commit fcc0126

Please sign in to comment.