fixed CR-PY-1, added test

This commit is contained in:
Ekaterina Tuzova
2011-06-28 21:37:42 +04:00
parent 6eb9420291
commit 4d93d5a6ac
2 changed files with 8 additions and 2 deletions
@@ -83,8 +83,8 @@ public class SphinxDocString extends StructuredDocString {
if (tagEnd < 0) return index;
String tagName = line.substring(1, tagEnd);
String tagValue = line.substring(tagEnd).trim();
tagValue = tagValue.replaceAll(":py:class:", "");
tagValue = tagValue.replaceAll(":class:", "");
tagValue = StringUtil.replace(tagValue, ":py:class:", "");
tagValue = StringUtil.replace(tagValue, ":class:", "");
tagValue = tagValue.replaceAll("`(\\w+)`", "$1");
int pos = tagValue.indexOf(':');
if (pos < 0) return index;
@@ -185,6 +185,12 @@ public class PyTypeTest extends PyLightFixtureTestCase {
assertEquals("int", type.getName());
}
public void testRestClassType() { //PY-3849
PyClassType type = (PyClassType) doTest("class Foo: pass\ndef foo(limit):\n" +
" ''':param :class:`Foo` limit: maximum number of stack frames to show'''\n" +
" expr = limit");
assertEquals("Foo", type.getName());
}
private PyType doTest(final String text) {
myFixture.configureByText(PythonFileType.INSTANCE, text);