File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff 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" );
You can’t perform that action at this time.
0 commit comments