all repos — fluxbox @ e62176913405f98fce84a19d63cb211c6cfc3713

custom fork of the fluxbox windowmanager

testing replaceString
fluxgen fluxgen
commit

e62176913405f98fce84a19d63cb211c6cfc3713

parent

1faef3ac2d5a22be465676ea0345df901f7cf8b6

1 files changed, 16 insertions(+), 10 deletions(-)

jump to
M src/tests/StringUtiltest.ccsrc/tests/StringUtiltest.cc

@@ -28,13 +28,6 @@ #include <vector>

#include <iostream> #include <memory> -#ifdef UDS -#include <uds/init.hh> -#include <uds/uds.hh> -// configure UDS -uds::uds_flags_t uds::flags = uds::leak_check|uds::log_allocs; -#endif - using namespace std; using namespace FbTk;

@@ -132,13 +125,26 @@ total_pos += pos;

} } int main() { -#ifdef UDS - uds::Init uds_init; -#endif + try { + string replaceme = "something((((otherthanthis)could[be]changed"; + + string newstr = StringUtil::replaceString(replaceme, "(", "\\("); + + newstr = StringUtil::replaceString(newstr, ")", "\\)"); + newstr = StringUtil::replaceString(newstr, "be", "not be"); + + cerr<<"original = "<<replaceme<<endl; + cerr<<"newstr = "<<newstr<<endl; + } catch (std::exception e) { + cerr<<"exception: "<<e.what()<<endl; + } cerr<<"Testing stringtok."<<endl; testStringtok(); cerr<<"Testing expandFilename."<<endl; testExpandFilename(); cerr<<"Testing strcasestr."<<endl; testStrcasestr(); + + + }