From e16866e072f94410321d70daedbcb855ea878cac Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 6 Nov 2011 15:56:40 -0600 Subject: Actually move the kde files that were renamed in the last commit --- kdecore/tests/kstringhandlertest.cpp | 97 ------------------------------------ 1 file changed, 97 deletions(-) delete mode 100644 kdecore/tests/kstringhandlertest.cpp (limited to 'kdecore/tests/kstringhandlertest.cpp') diff --git a/kdecore/tests/kstringhandlertest.cpp b/kdecore/tests/kstringhandlertest.cpp deleted file mode 100644 index 2efdc96fc..000000000 --- a/kdecore/tests/kstringhandlertest.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "kstringhandler.h" -#include -using std::cout; -using std::endl; - -bool check(const TQString &txt, const TQString &a, const TQString &b) -{ - if ( a != b ) { - cout << "ERROR: Tested " << txt.latin1() << ", expected" << endl; - cout << "'" << b.latin1() << "' (" << b.length() << " chars)" << endl; - cout << "but got" << endl; - cout << "'" << a.latin1() << "' (" << a.length() << " chars)" << endl; - exit( 1 ); - } - return true; -} - -int main(int argc, char *argv[]) -{ - TQString test = "The quick brown fox jumped over the lazy bridge. "; - - check("word(test, 3)", - KStringHandler::word(test, 2), - "brown"); - check("word(test, \"3:5\")", - KStringHandler::word(test, "2:4"), - "brown fox jumped"); - check("insword(test, \"very\", 1)", - KStringHandler::insword(test, "very", 1), - "The very quick brown fox jumped over the lazy bridge. "); - check("setword(test, \"very\", 1)", - KStringHandler::setword(test, "very", 1), - "The very brown fox jumped over the lazy bridge. "); - check("remrange(test, \"4:6\")", - KStringHandler::remrange(test, "4:6"), - "The quick brown fox lazy bridge. " ); - check("remrange(test, \"4:8\")", - KStringHandler::remrange(test, "4:8"), - "The quick brown fox "); - check("remword(test, 4)", - KStringHandler::remword(test, 4), - "The quick brown fox over the lazy bridge. "); - check("remword(test, \"lazy\")", - KStringHandler::remword(test, "lazy"), - "The quick brown fox jumped over the bridge. "); - check("capwords(test)", - KStringHandler::capwords(test), - "The Quick Brown Fox Jumped Over The Lazy Bridge. "); - check("reverse(test)", - KStringHandler::reverse(test), - " bridge. lazy the over jumped fox brown quick The"); - TQString result; - result = KStringHandler::ljust(test, 70); - if (result.length() != 70) - { - printf("Length = %d, expected 70.\n", result.length()); - exit(1); - } - check("ljust(test, 70)", - result, - "The quick brown fox jumped over the lazy bridge. "); - result = KStringHandler::rjust(test, 70); - if (result.length() != 70) - { - printf("Length = %d, expected 70.\n", result.length()); - exit(1); - } - check("rjust(test, 70)", - result, - " The quick brown fox jumped over the lazy bridge."); - result = KStringHandler::center(test, 70); - if (result.length() != 70) - { - printf("Length = %d, expected 70.\n", result.length()); - exit(1); - } - check("center(test, 70)", - result, - " The quick brown fox jumped over the lazy bridge. "); - - test = "Click on http://foo@bar:www.kde.org/yoyo/dyne.html#a1 for info."; - check( "tagURLs()", KStringHandler::tagURLs( test ), - "Click on http://foo@bar:www.kde.org/yoyo/dyne.html#a1 for info." ); - - test = "http://www.foo.org/story$806"; - check( "tagURLs()", KStringHandler::tagURLs( test ), - "http://www.foo.org/story$806" ); - -#if 0 - // XFAIL - i.e. this needs to be fixed, but has never been - test = "<a href=www.foo.com>"; - check( "tagURLs()", KStringHandler::tagURLs( test ), - "<a href=www.foo.com>" ); -#endif - - cout << "All OK!" << endl; -} -- cgit v1.2.1