Update of /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756/tests_completions/org/python/pydev/editor/codecompletion
Modified Files:
PyContextInformationValidatorTest.java
Added Files:
PyCalltipsContextInformationTest.java
Log Message:
- Interactive console: backspace will also delete the selected text
- Code completion: calltips context info correctly made 'bold'
--- NEW FILE: PyCalltipsContextInformationTest.java ---
package org.python.pydev.editor.codecompletion;
import org.eclipse.jface.text.Document;
import junit.framework.TestCase;
public class PyCalltipsContextInformationTest extends TestCase {
protected void setUp() throws Exception {
super.setUp();
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testCalltips() throws Exception {
PyCalltipsContextInformation info = new PyCalltipsContextInformation("(a, b)", 7);
PyContextInformationValidator validator = new PyContextInformationValidator();
Document doc = new Document("callIt(a, b)");
validator.install(info, doc, -1);
assertTrue(!validator.isContextInformationValid(0));
assertTrue(!validator.isContextInformationValid(6));
assertTrue(validator.isContextInformationValid(7));
assertTrue(validator.isContextInformationValid(11));
assertTrue(!validator.isContextInformationValid(12));
doc = new Document("callIt(param1, param2");
validator.install(info, doc, -1);
assertTrue(validator.isContextInformationValid(12));
}
}
Index: PyContextInformationValidatorTest.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/PyContextInformationValidatorTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyContextInformationValidatorTest.java 25 Mar 2007 16:08:59 -0000 1.1
--- PyContextInformationValidatorTest.java 12 Apr 2008 15:40:09 -0000 1.2
***************
*** 17,23 ****
public void testIt() throws Exception {
PyContextInformationValidator validator = new PyContextInformationValidator();
! assertEquals(1, validator.getCharCount(new Document("m1(a,b)\n"), 3, 5, ",", "", true));
! assertEquals(1, validator.getCharCount(new Document("m1('',b)\n"), 3, 6, ",", "", true));
! assertEquals(1, validator.getCharCount(new Document("m1('''(''',b)\n"), 3, 11, ",", "", true));
}
--- 17,23 ----
public void testIt() throws Exception {
PyContextInformationValidator validator = new PyContextInformationValidator();
! assertEquals(1, validator.getCurrentParameter(new Document("m1(a,b)\n"), 3, 5, ",", "", true));
! assertEquals(1, validator.getCurrentParameter(new Document("m1('',b)\n"), 3, 6, ",", "", true));
! assertEquals(1, validator.getCurrentParameter(new Document("m1('''(''',b)\n"), 3, 11, ",", "", true));
}
|