use of com.goide.psi.GoStringLiteral in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoStringLiteralEscaperTest method testEscaperOffsetInSingleEscapedCharString.
public void testEscaperOffsetInSingleEscapedCharString() {
GoStringLiteral expr = createStringFromText("\\n");
assertNotNull(expr);
LiteralTextEscaper<? extends PsiLanguageInjectionHost> escaper = expr.createLiteralTextEscaper();
TextRange range = TextRange.create(1, 3);
escaper.decode(range, new StringBuilder());
assertEquals(1, escaper.getOffsetInHost(0, range));
assertEquals(3, escaper.getOffsetInHost(1, range));
assertEquals(-1, escaper.getOffsetInHost(2, range));
}
Aggregations