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