Skip to content

Commit

Permalink
Add tests for replace_chars
Browse files Browse the repository at this point in the history
  • Loading branch information
AThousandShips committed Sep 12, 2024
1 parent a736d56 commit 6e6cbbb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/core/string/test_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,15 @@ TEST_CASE("[String] replace_char") {
ERR_PRINT_ON
}

TEST_CASE("[String] replace_chars") {
String s = "Banana";
CHECK(s.replace_chars({ 'B', 'n' }, 'x') == "xaxaxa");
CHECK(s.replace_chars({}, 'x') == "Banana");
ERR_PRINT_OFF
CHECK(s.replace_chars({ 'B', 'n' }, '\0') == "");
ERR_PRINT_ON
}

TEST_CASE("[String] Insertion") {
String s = "Who is Frederic?";
s = s.insert(s.find("?"), " Chopin");
Expand Down

0 comments on commit 6e6cbbb

Please sign in to comment.