Skip to content

Commit

Permalink
Add test for new function
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerkaraszewski committed Jul 25, 2024
1 parent 0a5f357 commit b0bf93e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/tests/LibStuffTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct LibStuff : tpunit::TestFixture {
TEST(LibStuff::testBase32Conversion),
TEST(LibStuff::testContains),
TEST(LibStuff::testFirstOfMonth),
TEST(LibStuff::SREReplaceTest),
TEST(LibStuff::SQResultTest)
)
{ }
Expand Down Expand Up @@ -638,6 +639,15 @@ struct LibStuff : tpunit::TestFixture {
ASSERT_EQUAL(SFirstOfMonth(timeStamp4, -25), "2018-06-01");
}

void SREReplaceTest() {
// This specifically tests multiple replacements and that the final string is longer than the starting string.
string from = "a cat is not a dog it is a cat";
string expected = "a elephant is not a dog it is a elephant";
string result = SREReplace("cat", from, "elephant");

ASSERT_EQUAL(result, expected);
}

void SQResultTest() {
SQLite db(":memory:", 1000, 1000, 1);
db.beginTransaction(SQLite::TRANSACTION_TYPE::EXCLUSIVE);
Expand Down

0 comments on commit b0bf93e

Please sign in to comment.