23 #include "strings.hpp" 24 #include "teststrings.h" 26 bool TestStringsWrapUrls::executeTest()
28 QString exampleString =
"http://www.example.com www.example.com ftp://ftp.example.com www.\nwww http:// www.link.with.tag.com< http://x http://www.example.com?var1=1&var2=2#anchor www.no-spacebar.com";
31 testLog <<
"Result: " << resultString;
32 return resultString.count(
"<a href=") == 7;
static QString wrapUrlsWithHtmlATags(const QString &str)
Detects all links within a given string and wraps them in <a href> tags.