aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2005-11-22 21:58:25 (GMT)
committerfluxgen <fluxgen>2005-11-22 21:58:25 (GMT)
commite62176913405f98fce84a19d63cb211c6cfc3713 (patch)
treebfe953b8fc7a40fa43ae7323fc8b06167c45cd63
parent1faef3ac2d5a22be465676ea0345df901f7cf8b6 (diff)
downloadfluxbox-e62176913405f98fce84a19d63cb211c6cfc3713.zip
fluxbox-e62176913405f98fce84a19d63cb211c6cfc3713.tar.bz2
testing replaceString
-rw-r--r--src/tests/StringUtiltest.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/tests/StringUtiltest.cc b/src/tests/StringUtiltest.cc
index 78afcb1..768ad7e 100644
--- a/src/tests/StringUtiltest.cc
+++ b/src/tests/StringUtiltest.cc
@@ -28,13 +28,6 @@
28#include <iostream> 28#include <iostream>
29#include <memory> 29#include <memory>
30 30
31#ifdef UDS
32#include <uds/init.hh>
33#include <uds/uds.hh>
34// configure UDS
35uds::uds_flags_t uds::flags = uds::leak_check|uds::log_allocs;
36#endif
37
38using namespace std; 31using namespace std;
39using namespace FbTk; 32using namespace FbTk;
40 33
@@ -132,13 +125,26 @@ void testGetStringBetween() {
132 } 125 }
133} 126}
134int main() { 127int main() {
135#ifdef UDS 128 try {
136 uds::Init uds_init; 129 string replaceme = "something((((otherthanthis)could[be]changed";
137#endif 130
131 string newstr = StringUtil::replaceString(replaceme, "(", "\\(");
132
133 newstr = StringUtil::replaceString(newstr, ")", "\\)");
134 newstr = StringUtil::replaceString(newstr, "be", "not be");
135
136 cerr<<"original = "<<replaceme<<endl;
137 cerr<<"newstr = "<<newstr<<endl;
138 } catch (std::exception e) {
139 cerr<<"exception: "<<e.what()<<endl;
140 }
138 cerr<<"Testing stringtok."<<endl; 141 cerr<<"Testing stringtok."<<endl;
139 testStringtok(); 142 testStringtok();
140 cerr<<"Testing expandFilename."<<endl; 143 cerr<<"Testing expandFilename."<<endl;
141 testExpandFilename(); 144 testExpandFilename();
142 cerr<<"Testing strcasestr."<<endl; 145 cerr<<"Testing strcasestr."<<endl;
143 testStrcasestr(); 146 testStrcasestr();
147
148
149
144} 150}