void () { final PyStringLiteralExpression expr = createLiteralFromText("'\\nfoo'"); assertNotNull(expr); final LiteralTextEscaper<? extends PsiLanguageInjectionHost> escaper = expr.createLiteralTextEscaper(); final TextRange newLineFoo = TextRange.create(1, 6); assertEquals(1, escaper.getOffsetInHost(0, newLineFoo)); assertEquals(3, escaper.getOffsetInHost(1, newLineFoo)); assertEquals(4, escaper.getOffsetInHost(2, newLineFoo)); assertEquals(5, escaper.getOffsetInHost(3, newLineFoo)); assertEquals(6, escaper.getOffsetInHost(4, newLineFoo)); assertEquals(-1, escaper.getOffsetInHost(5, newLineFoo)); }