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){