@Test public void testCharsetLookup() { Charset c1 = CharsetUtil.lookup("us-ascii"); Charset c2 = CharsetUtil.lookup("ascii"); Assert.assertEquals(Charsets.US_ASCII, c1); Assert.assertEquals(Charsets.US_ASCII, c2); }
@Test public void testCharsetLookupFailure() { Charset c1 = CharsetUtil.lookup("whatever"); Assert.assertNull(c1); }
@Test public void testCharsetLookupNullInput() { Charset c1 = CharsetUtil.lookup(null); Assert.assertNull(c1); }