Skip to content

Commit 1559542

Browse files
committed
#181-Test CppStringT::operator* ()
Completed. Validated.
1 parent 20c35e8 commit 1559542

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,23 @@ namespace cppstringstests
18321832
Assert::AreEqual(L"a bcd ", L" a bcd "cs.lstrip().c_str());
18331833
}
18341834

1835+
TEST_METHOD(operator_times)
1836+
{
1837+
pcs::CppString text("Abcd,");
1838+
Assert::AreEqual("", (text * -1).c_str());
1839+
Assert::AreEqual("", (text * 0).c_str());
1840+
Assert::AreEqual(text.c_str(), (text * 1).c_str());
1841+
Assert::AreEqual((text + text).c_str(), (text * 2).c_str());
1842+
Assert::AreEqual((text + text + text).c_str(), (text * 3).c_str());
1843+
1844+
pcs::CppWString wtext(L"Abcd,");
1845+
Assert::AreEqual(L"", (wtext * -1).c_str());
1846+
Assert::AreEqual(L"", (wtext * 0).c_str());
1847+
Assert::AreEqual(wtext.c_str(), (wtext * 1).c_str());
1848+
Assert::AreEqual((wtext + wtext).c_str(), (wtext * 2).c_str());
1849+
Assert::AreEqual((wtext + wtext + wtext).c_str(), (wtext * 3).c_str());
1850+
}
1851+
18351852
TEST_METHOD(partition)
18361853
{
18371854
pcs::CppString s("abcd#123efg");

0 commit comments

Comments
 (0)