jaroslav@296: /** jaroslav@296: * Back 2 Browser Bytecode Translator jaroslav@296: * Copyright (C) 2012 Jaroslav Tulach jaroslav@296: * jaroslav@296: * This program is free software: you can redistribute it and/or modify jaroslav@296: * it under the terms of the GNU General Public License as published by jaroslav@296: * the Free Software Foundation, version 2 of the License. jaroslav@296: * jaroslav@296: * This program is distributed in the hope that it will be useful, jaroslav@296: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@296: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@296: * GNU General Public License for more details. jaroslav@296: * jaroslav@296: * You should have received a copy of the GNU General Public License jaroslav@296: * along with this program. Look for COPYING file in the top folder. jaroslav@296: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@296: */ jaroslav@346: package org.apidesign.bck2brwsr.tck; jaroslav@296: jaroslav@346: import org.apidesign.bck2brwsr.vmtest.Compare; jaroslav@346: import org.apidesign.bck2brwsr.vmtest.VMTest; jaroslav@296: import org.testng.annotations.Factory; jaroslav@296: jaroslav@296: /** jaroslav@296: * jaroslav@296: * @author Jaroslav Tulach jaroslav@296: */ jaroslav@1384: public class CharacterTest { jaroslav@1384: @Compare public boolean dolarJavaStart() { jaroslav@1384: return Character.isJavaIdentifierStart('$'); jaroslav@1384: } jaroslav@1384: jaroslav@1384: @Compare public boolean dolarJavaPart() { jaroslav@1384: return Character.isJavaIdentifierPart('$'); jaroslav@1384: } jaroslav@1384: jaroslav@1384: @Compare public boolean numberJavaStart() { jaroslav@1384: return Character.isJavaIdentifierStart('3'); jaroslav@1384: } jaroslav@1384: jaroslav@1384: @Compare public boolean numberJavaPart() { jaroslav@1384: return Character.isJavaIdentifierPart('3'); jaroslav@430: } jaroslav@1480: jaroslav@1480: @Compare public String testWhiteSpaces() { jaroslav@1480: StringBuilder sb = new StringBuilder(); jaroslav@1480: for (int i = 1; i < 128; i++) { jaroslav@1480: char ch = (char)i; jaroslav@1480: if (Character.isWhitespace(ch)) { jaroslav@1480: sb.append(i).append(","); jaroslav@1480: } jaroslav@1480: } jaroslav@1480: return sb.toString(); jaroslav@1480: } jaroslav@1382: jaroslav@296: @Factory jaroslav@296: public static Object[] create() { jaroslav@1384: return VMTest.create(CharacterTest.class); jaroslav@296: } jaroslav@328: jaroslav@296: }