Commit 070aed44e641f430a620be8fe8d8072e5bdaa2c1
- Diff rendering mode:
- inline
- side by side
tests/TestAmarok.cpp
(14 / 0)
|   | |||
| 105 | 105 | /* any other good ideas what to test here? */ | |
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | void TestAmarok::testDecapitateString() | ||
| 109 | { | ||
| 110 | QCOMPARE( Amarok::decapitateString( "", "" ), QString( "" ) ); | ||
| 111 | |||
| 112 | QCOMPARE( Amarok::decapitateString( "abc123", "abc456" ), QString( "123" ) ); | ||
| 113 | QCOMPARE( Amarok::decapitateString( "abc", "123" ), QString( "abc" ) ); | ||
| 114 | QCOMPARE( Amarok::decapitateString( "abc", "" ), QString( "abc" ) ); | ||
| 115 | QCOMPARE( Amarok::decapitateString( "", "abc" ), QString( "" ) ); | ||
| 116 | } | ||
| 117 | |||
| 108 | 118 | void TestAmarok::testEscapeHTMLAttr() | |
| 109 | 119 | { | |
| 120 | QCOMPARE( Amarok::escapeHTMLAttr( "" ), QString( "" ) ); | ||
| 121 | |||
| 110 | 122 | QCOMPARE( Amarok::escapeHTMLAttr( "test\"fu=bar" ), QString( "test%22fu=bar" ) ); | |
| 111 | 123 | QCOMPARE( Amarok::escapeHTMLAttr( "test#fu=bar" ), QString( "test%23fu=bar" ) ); | |
| 112 | 124 | QCOMPARE( Amarok::escapeHTMLAttr( "test%fu=bar" ), QString( "test%25fu=bar" ) ); | |
| … | … | ||
| 201 | 201 | ||
| 202 | 202 | void TestAmarok::testUnescapeHTMLAttr() | |
| 203 | 203 | { | |
| 204 | QCOMPARE( Amarok::unescapeHTMLAttr( "" ), QString( "" ) ); | ||
| 205 | |||
| 204 | 206 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%22fu=bar" ), QString( "test\"fu=bar" ) ); | |
| 205 | 207 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%23fu=bar" ), QString( "test#fu=bar" ) ); | |
| 206 | 208 | QCOMPARE( Amarok::unescapeHTMLAttr( "test%25fu=bar" ), QString( "test%fu=bar" ) ); |
tests/TestAmarok.h
(1 / 1)
|   | |||
| 34 | 34 | void testCleanPath(); | |
| 35 | 35 | void testComputeScore(); | |
| 36 | 36 | void testConciseTimeSince(); | |
| 37 | void testDecapitateString(); | ||
| 37 | 38 | void testEscapeHTMLAttr(); | |
| 38 | 39 | void testExtension(); | |
| 39 | 40 | void testManipulateThe(); | |
| … | … | ||
| 49 | 49 | //KUrl testMostLocalURL( const KUrl &url ); | |
| 50 | 50 | ||
| 51 | 51 | /* | |
| 52 | QString decapitateString( const QString &input, const QString &ref ); | ||
| 53 | 52 | QString proxyForUrl( const QString& url ); // how to test? | |
| 54 | 53 | QString proxyForProtocol( const QString& protocol ); // how to test? */ | |
| 55 | 54 | }; |

