View Javadoc
1   /**
2    * Copyright 2010-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.util;
17  
18  import static org.junit.Assert.assertEquals;
19  import static org.junit.Assert.assertFalse;
20  import static org.junit.Assert.assertTrue;
21  
22  import org.junit.Test;
23  
24  public class AsciiTest {
25  
26  	@Test
27  	public void test() {
28  		assertTrue(Ascii.isDigit('0'));
29  		assertFalse(Ascii.isDigit('a'));
30  		assertFalse(Ascii.isLowerCase('Z'));
31  		assertFalse(Ascii.isLowerCase((char) 0));
32  		assertFalse(Ascii.isLowerCase((char) 500));
33  		assertTrue(Ascii.isLetter('a'));
34  		assertTrue(Ascii.isLetter('A'));
35  		assertFalse(Ascii.isLetter('0'));
36  		assertEquals('0', Ascii.flip('5'));
37  		assertEquals('5', Ascii.flip('0'));
38  		assertEquals('a', Ascii.flip('n'));
39  		assertEquals('n', Ascii.flip('a'));
40  		assertEquals('A', Ascii.flip('N'));
41  		assertEquals('N', Ascii.flip('A'));
42  	}
43  
44  }