* fix patchCharsetEncoding-test (patchCharsetEncoding now returns null on input null)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7465 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
f1ori 14 years ago
parent 431f780f41
commit 01cb3bbaec

@ -10,7 +10,7 @@ public class htmlParserTest extends TestCase {
public void testGetRealCharsetEncoding() {
String[][] testStrings = new String[][] {
new String[]{null,"UTF-8"},
new String[]{null,null},
new String[]{"windows1250","windows-1250"},
new String[]{"windows_1250","windows-1250"},
new String[]{"ISO-8859-1","ISO-8859-1"},
@ -26,14 +26,15 @@ public class htmlParserTest extends TestCase {
for (int i=0; i < testStrings.length; i++) {
// desired conversion result
String shouldBe = testStrings[i][1].toLowerCase();
String shouldBe = testStrings[i][1];
shouldBe = shouldBe!=null ? shouldBe.toLowerCase() : null;
// conversion result
String charset = htmlParser.patchCharsetEncoding(testStrings[i][0]).toLowerCase();
String charset = htmlParser.patchCharsetEncoding(testStrings[i][0]);
// test if equal
assertEquals(shouldBe, charset);
System.out.println("testGetRealCharsetEncoding: " + testStrings[i][0] + " -> " + charset + " | Supported: " + Charset.isSupported(charset));
assertEquals(shouldBe, charset!=null ? charset.toLowerCase() : null);
System.out.println("testGetRealCharsetEncoding: " + (testStrings[i][0]!=null?testStrings[i][0]:"null") + " -> " + (charset!=null?charset:"null") + " | Supported: " + (charset!=null?Charset.isSupported(charset):false));
}

Loading…
Cancel
Save