11#include " ManapiString.hpp"
22
33#include " ./utest.h"
4- #include " ./tools.hpp"
54
6- UTEST (std_string, replace_1 ) {
5+ UTEST (std_string, str_replace_1 ) {
76 std::string a = " Hello$2!" ;
87 auto res = manapi::string::replace (a, " $2" , " , world" );
98
109 ASSERT_TRUE (a == " Hello, world!" );
1110 ASSERT_TRUE (1 == res);
1211}
1312
14- UTEST (std_string, replace_2 ) {
13+ UTEST (std_string, str_replace_2 ) {
1514 std::string a = " Hello$2!Hello$2!" ;
1615 auto res = manapi::string::replace (a, " $2" , " , world" );
1716
1817 ASSERT_TRUE (a == " Hello, world!Hello, world!" );
1918 ASSERT_TRUE (2 == res);
2019}
2120
22- UTEST (std_string, replace_3 ) {
21+ UTEST (std_string, str_replace_3 ) {
2322 std::string a = " Hello$2!Hello$2!" ;
2423 auto res = manapi::string::replace (a, " $2" , " , world" , 1 );
2524
2625 ASSERT_TRUE (a == " Hello, world!Hello$2!" );
2726 ASSERT_TRUE (1 == res);
2827}
2928
30- UTEST (std_string, replace_4 ) {
29+ UTEST (std_string, str_replace_4 ) {
3130 std::string a = " Hello$2!Hello$2!" ;
3231 auto res = manapi::string::replace (a, " $2" , " , world" , 0 );
3332
@@ -36,12 +35,12 @@ UTEST(std_string, replace_4) {
3635}
3736
3837
39- UTEST (std_string, replace_5 ) {
38+ UTEST (std_string, str_replace_5 ) {
4039 std::string a = " $2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2" ;
4140 auto res = manapi::string::replace (a, " $2" , " , world" , 9 );
4241
4342 ASSERT_TRUE (a == " , world, world, world, world, world, world, world, world, world$2$2$2$2$2$2$2$2$2$2$2$2$2$2$2" );
4443 ASSERT_TRUE (9 == res);
4544}
4645
47- MANAPIHTTP_TESTS_MAIN
46+ UTEST_MAIN ();
0 commit comments