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 @@ -876,5 +876,22 @@ namespace cppstringstests
876876 Assert::AreEqual (L" " , wres[2 ].c_str ());
877877 }
878878
879+ TEST_METHOD (removeprefix)
880+ {
881+ pcs::CppString s (" abcd" );
882+ Assert::AreEqual (" cd" , s.removeprefix (" ab" ).c_str ());
883+ Assert::AreEqual (" abcd" , s.removeprefix (" ba" ).c_str ());
884+ Assert::AreEqual (" abcd" , s.removeprefix (" " ).c_str ());
885+ Assert::AreEqual (" abaabcd" , " abbabaabcd" cs.removeprefix (" abb" ).c_str ());
886+ Assert::AreEqual (" cdab" , " abcdab" cs.removeprefix (" ab" ).c_str ());
887+
888+ pcs::CppWString ws (L" abcd" );
889+ Assert::AreEqual (L" cd" , ws.removeprefix (L" ab" ).c_str ());
890+ Assert::AreEqual (L" abcd" , ws.removeprefix (L" ba" ).c_str ());
891+ Assert::AreEqual (L" abcd" , ws.removeprefix (L" " ).c_str ());
892+ Assert::AreEqual (L" abaabcd" , L" abbabaabcd" cs.removeprefix (L" abb" ).c_str ());
893+ Assert::AreEqual (L" cdab" , L" abcdab" cs.removeprefix (L" ab" ).c_str ());
894+ }
895+
879896 };
880897}
You can’t perform that action at this time.
0 commit comments