Skip to content

Commit 7ca47c7

Browse files
committed
#148 - Test CppStringT::isspace() with char and wchar_t
Tested.
1 parent 740ee0f commit 7ca47c7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,5 +651,21 @@ namespace cppstringstests
651651
}
652652
}
653653

654+
TEST_METHOD(isspace)
655+
{
656+
Assert::IsFalse(CppString().isspace());
657+
for (int c = 0; c <= 255; ++c) {
658+
const char ch{ char(c) };
659+
pcs::CppString s(5, ch);
660+
Assert::AreEqual(pcs::is_space(ch), s.isspace());
661+
}
662+
663+
Assert::IsFalse(CppWString().isspace());
664+
for (int c = 0; c <= 0xffff; ++c) {
665+
const wchar_t wch{ wchar_t(c) };
666+
pcs::CppWString ws(5, wch);
667+
Assert::AreEqual(pcs::is_space(wch), ws.isspace());
668+
}
669+
}
654670
};
655671
}

0 commit comments

Comments
 (0)