Skip to content

Commit

Permalink
string: fix deprecation warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedede committed Mar 24, 2024
1 parent 72de8b4 commit c4faa21
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions string/tests/split.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Test(split_empty) {

Checks {
v1 = string::split_by(s, "abcd");
v2 = string::cut(s, " ");
v2 = string::split(s, " ", string::keep_empty);
}

Postconditions {
Expand All @@ -29,7 +29,7 @@ Test(split_word) {

Checks {
v1 = string::split_by(s, " ");
v2 = string::cut(s, " ");
v2 = string::split(s, " ", string::keep_empty);
}

Postconditions {
Expand All @@ -48,17 +48,17 @@ Test(split_words) {

Checks {
v1 = string::split_by(s, ", ");
v2 = string::cut(s, " ");
v3 = string::cut(s, ", ");
v2 = string::split(s, " ", string::keep_empty);
v3 = string::split(s, ", ", string::keep_empty);
}

Postconditions {
std::vector<string_view> e1{"word1", "word2", "word3"};
std::vector<string_view> e2{"word1", "", "word2,", "word3"};
std::vector<string_view> e3{"word1 word2", "word3"};
TestAssert(v1 == e1);
TestAssert(v2 == e2);
TestAssert(v3 == e3);
TestEqual(v1, e1);
TestEqual(v2, e2);
TestEqual(v3, e3);
}
}
} // namespace aw

0 comments on commit c4faa21

Please sign in to comment.