Skip to content

Commit 78c5ebc

Browse files
committed
#154 - Test CppStringT::lower() with char and wchar_t
Completed.
1 parent 383adcd commit 78c5ebc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cpp-strings-tests/cpp-strings-tests.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,27 @@ namespace cppstringstests
779779
Assert::AreEqual(L"abc..", ws.ljust(5, '.').c_str());
780780
}
781781

782+
TEST_METHOD(lower)
783+
{
784+
for (int c = 0; c <= 255; ++c) {
785+
const char ch{ char(c) };
786+
constexpr int N{ 5 };
787+
pcs::CppString s(N, ch);
788+
s.lower();
789+
for (int i=0; i < N; ++i)
790+
Assert::AreEqual(pcs::to_lower(ch), s[i]);
791+
}
792+
793+
for (int c = 0; c <= 0xffff; ++c) {
794+
const wchar_t wch{ wchar_t(c) };
795+
constexpr int N{ 5 };
796+
pcs::CppWString ws(N, wch);
797+
ws.lower();
798+
for (int i = 0; i < N; ++i)
799+
Assert::AreEqual(pcs::to_lower(wch), ws[i]);
800+
}
801+
}
802+
782803

783804
};
784805
}

0 commit comments

Comments
 (0)