Skip to content

Instantly share code, notes, and snippets.

@azusa
Created July 11, 2012 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azusa/3088852 to your computer and use it in GitHub Desktop.
Save azusa/3088852 to your computer and use it in GitHub Desktop.
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
import org.junit.Test;
public class CharacterTest {
@Test
public void test() {
assertThat(Character.isJavaIdentifierPart('文'), is(true));
assertThat(Character.isJavaIdentifierPart('_'), is(true));
assertThat(Character.isJavaIdentifierPart('$'), is(true));
assertThat(Character.isJavaIdentifierPart('#'), is(false));
assertThat(Character.isJavaIdentifierPart('@'), is(false));
assertThat(Character.isJavaIdentifierPart('、'), is(false));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment