Author: sback
Date: 2007-07-09 21:55:47 +0000 (Mon, 09 Jul 2007)
New Revision: 14007
Modified:
trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
Log:
decode() "tolerant" argument tested
Modified: trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
===================================================================
--- trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
2007-07-09 21:28:04 UTC (rev 14006)
+++ trunk/freenet/test/freenet/support/URLEncoderDecoderTest.java
2007-07-09 21:55:47 UTC (rev 14007)
@@ -146,4 +146,21 @@
for (int i = 0; i<toDecode.length(); i++)
assertTrue(isDecodeRaisingEncodedException("%"+toDecode.substring(i,i+1),false));
}
+
+ /**
+ * Tests decode(String,boolean) method
+ * trying the boolean argument, to verify
+ * if it work correctly as a hack to allow users
+ * to paste in URLs containing %'s.
+ */
+ public void testTolerantDecoding() {
+ String toDecode = "%%%";
+
+ try {
+ assertEquals(URLDecoder.decode(toDecode,true),toDecode);
+ } catch (URLEncodedFormatException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
}
\ No newline at end of file