1 54 package org.w3c.tidy; 55 56 import junit.framework.TestCase; 57 58 59 64 public class TidyUtilsTest extends TestCase 65 { 66 67 71 public TidyUtilsTest(String name) 72 { 73 super(name); 74 } 75 76 79 public void testIsInValuesIgnoreCaseSuccessfull() 80 { 81 String [] validValues = new String []{"first", "Second", "THIRD"}; 82 String stringToCheck = "second"; 83 assertTrue(TidyUtils.isInValuesIgnoreCase(validValues, stringToCheck)); 84 } 85 86 89 public void testIsInValuesIgnoreCaseFail() 90 { 91 String [] validValues = new String []{"first", "Second", "THIRD"}; 92 String stringToCheck = "secon"; 93 assertFalse(TidyUtils.isInValuesIgnoreCase(validValues, stringToCheck)); 94 } 95 96 99 public void testIsCharEncodingSupported() 100 { 101 assertTrue(TidyUtils.isCharEncodingSupported("utf8")); 102 assertTrue(TidyUtils.isCharEncodingSupported("UTF-8")); 103 assertTrue(TidyUtils.isCharEncodingSupported("US-ASCII")); 104 assertTrue(TidyUtils.isCharEncodingSupported("ASCII")); 105 assertTrue(TidyUtils.isCharEncodingSupported("LATIN1")); 106 assertTrue(TidyUtils.isCharEncodingSupported("ISO-8859-1")); 107 assertTrue(TidyUtils.isCharEncodingSupported("WINDOWS-1252")); 108 assertTrue(TidyUtils.isCharEncodingSupported("ISO2022")); 109 assertTrue(TidyUtils.isCharEncodingSupported("ISO-2022-JP")); 110 assertTrue(TidyUtils.isCharEncodingSupported("BIG5")); 111 assertTrue(TidyUtils.isCharEncodingSupported("UTF16")); 112 assertTrue(TidyUtils.isCharEncodingSupported("UTF16BE")); 113 assertTrue(TidyUtils.isCharEncodingSupported("UTF16LE")); 114 assertTrue(TidyUtils.isCharEncodingSupported("UTF-16")); 115 assertTrue(TidyUtils.isCharEncodingSupported("UTF-16BE")); 116 assertTrue(TidyUtils.isCharEncodingSupported("UTF-16LE")); 117 assertTrue(TidyUtils.isCharEncodingSupported("CP858")); 118 assertTrue(TidyUtils.isCharEncodingSupported("ibm858")); 119 assertTrue(TidyUtils.isCharEncodingSupported("Macintosh Roman")); 120 assertTrue(TidyUtils.isCharEncodingSupported("WiN1252")); 121 assertTrue(TidyUtils.isCharEncodingSupported("SHIFTJIS")); 122 } 123 124 } | Popular Tags |