@Test public void testRefToTextAttributeForCurrentRule() throws Exception {
        String action = "$ctx.text; $text";

		// this is the expected translation for all cases
		String expected =
			"_localctx.text; _input.getText(_localctx.start, _input.LT(-1))";

		testActions(attributeTemplate, "init", action, expected);
		testActions(attributeTemplate, "inline", action, expected);
		testActions(attributeTemplate, "finally", action, expected);
    }
Regression test for issue #1295
$e.v yields incorrect value 0 in "e returns [int v] : '1' {$v = 1;} | '(' e ')' {$v = $e.v;} ;"
https://github.com/antlr/antlr4/issues/1295
tool-testsuite/test/org/antlr/v4/test/tool/TestActionTranslation.java