Commit 070aed44e641f430a620be8fe8d8072e5bdaa2c1

Tests for Amarok::decapitateString();
  
105105 /* any other good ideas what to test here? */
106106}
107107
108void 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
108118void TestAmarok::testEscapeHTMLAttr()
109119{
120 QCOMPARE( Amarok::escapeHTMLAttr( "" ), QString( "" ) );
121
110122 QCOMPARE( Amarok::escapeHTMLAttr( "test\"fu=bar" ), QString( "test%22fu=bar" ) );
111123 QCOMPARE( Amarok::escapeHTMLAttr( "test#fu=bar" ), QString( "test%23fu=bar" ) );
112124 QCOMPARE( Amarok::escapeHTMLAttr( "test%fu=bar" ), QString( "test%25fu=bar" ) );
201201
202202void TestAmarok::testUnescapeHTMLAttr()
203203{
204 QCOMPARE( Amarok::unescapeHTMLAttr( "" ), QString( "" ) );
205
204206 QCOMPARE( Amarok::unescapeHTMLAttr( "test%22fu=bar" ), QString( "test\"fu=bar" ) );
205207 QCOMPARE( Amarok::unescapeHTMLAttr( "test%23fu=bar" ), QString( "test#fu=bar" ) );
206208 QCOMPARE( Amarok::unescapeHTMLAttr( "test%25fu=bar" ), QString( "test%fu=bar" ) );
  
3434 void testCleanPath();
3535 void testComputeScore();
3636 void testConciseTimeSince();
37 void testDecapitateString();
3738 void testEscapeHTMLAttr();
3839 void testExtension();
3940 void testManipulateThe();
4949 //KUrl testMostLocalURL( const KUrl &url );
5050
5151 /*
52 QString decapitateString( const QString &input, const QString &ref );
5352 QString proxyForUrl( const QString& url ); // how to test?
5453 QString proxyForProtocol( const QString& protocol ); // how to test? */
5554};