Examples of GoLiteralChar


Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralChar

        assertEquals(GoLiteral.Type.RawString, string.getType());
        assertEquals("b", string.getValue());


        GoLiteralChar aChar =
                getAs(GoLiteralChar.class,
                        getAs(GoLiteralExpression.class,
                                childAt(0,
                                        declarations[2].getExpressions()
                                )
                        ).getLiteral()
                );

        assertEquals(GoLiteral.Type.Char, aChar.getType());
        assertEquals(Character.valueOf('本'), aChar.getValue());

        aChar =
                getAs(GoLiteralChar.class,
                        getAs(GoLiteralExpression.class,
                                childAt(0,
                                        declarations[3].getExpressions()
                                )
                        ).getLiteral()
                );

        assertEquals(GoLiteral.Type.Char, aChar.getType());
        assertEquals('ሴ', (char)aChar.getValue());
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.literals.GoLiteralChar

        GoVarDeclaration[] declarations =
                childAt(0,
                        file.getGlobalVariables()
                ).getDeclarations();

        GoLiteralChar aChar;

        for (Map.Entry<Integer, Integer> entry : testRuneValues.entrySet()) {
            Integer key = entry.getKey();
            Integer value = entry.getValue();
            aChar =
                    getAs(GoLiteralChar.class,
                            getAs(GoLiteralExpression.class,
                                    childAt(0,
                                            declarations[key].getExpressions()
                                    )
                            ).getLiteral()
                    );

            assertEquals(GoLiteral.Type.Char, aChar.getType());
            assertEquals(GoElementTypes.LITERAL_CHAR, aChar.getNode().getElementType());
            assertEquals(value, GoPsiUtils.getRuneValue(aChar.getText()));
        }

        List<String> badRuneValues = Arrays.asList("'aa'", "'\\xa'", "'\\0'", "'\\uDFFF'", "'\\U00110000'");

        for (String rune: badRuneValues){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.