[Pydev-cvs] org.python.pydev/tests/org/python/pydev/editor/codecompletion GeneralTests.java,NONE,1.1
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2004-09-17 19:22:47
|
Update of /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2281/tests/org/python/pydev/editor/codecompletion Modified Files: PythonShellTest.java Added Files: GeneralTests.java Log Message: Making refactoring. Index: PythonShellTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/codecompletion/PythonShellTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonShellTest.java 13 Sep 2004 19:47:54 -0000 1.2 --- PythonShellTest.java 17 Sep 2004 19:22:03 -0000 1.3 *************** *** 50,116 **** for (Iterator iter = list.iterator(); iter.hasNext();) { Object[] element = (Object[]) iter.next(); ! assertEquals("math",element[0]); ! assertEquals("This module is always available. It provides access to the\n"+ ! "mathematical functions defined by the C standard.",element[1]); ! } ! } public void testGetTokenCompletions() throws IOException, CoreException { String str = "\n\n\n\n\nimport math\n\n\n#testetestse\n\n\n\n\n"; ! List list = shell.getTokenCompletions("math",str); assertEquals(29, list.size()); ! // for (Iterator iter = list.iterator(); iter.hasNext();) { ! // Object[] element = (Object[]) iter.next(); ! // System.out.println(element[0]); ! // System.out.println(element[1]); ! // } ! } ! public void testErrorOnCompletions() throws IOException, CoreException { String str = "import math; class C dsdfas d not valid\n"; ! List list = shell.getTokenCompletions("math",str); assertEquals(1, list.size()); Object object[] = (Object[]) list.get(0); ! assertEquals("ERROR_COMPLETING",object[0]); ! } ! ! public void testOther(){ ! String str = getTestStr(); ! ! List list = shell.getClassCompletions("C",str); ! assertEquals(18, list.size()); ! list = shell.getTokenCompletions("C",str); ! assertEquals(17, list.size()); ! // for (Iterator iter = list.iterator(); iter.hasNext();) { ! // Object[] element = (Object[]) iter.next(); ! // System.out.println(element[0]); ! // System.out.println(element[1]); ! // } ! ! } ! /** ! * @return ! */ ! private String getTestStr() { ! String str = ! "class C(object): \n"+ ! " \n"+ ! " def __init__(self): \n"+ ! " print dir(self) \n"+ ! " \n"+ ! " def a(self): \n"+ ! " pass \n"+ ! " \n"+ ! " \n"+ ! " def b(self): \n"+ ! " self.c=1 \n"+ ! " pass \n"; ! return str; ! } ! } --- 50,109 ---- for (Iterator iter = list.iterator(); iter.hasNext();) { Object[] element = (Object[]) iter.next(); ! assertEquals("math", element[0]); ! assertEquals( ! "This module is always available. It provides access to the\n" ! + "mathematical functions defined by the C standard.", ! element[1]); ! } ! } public void testGetTokenCompletions() throws IOException, CoreException { String str = "\n\n\n\n\nimport math\n\n\n#testetestse\n\n\n\n\n"; ! List list = shell.getTokenCompletions("math", str); assertEquals(29, list.size()); ! // for (Iterator iter = list.iterator(); iter.hasNext();) { ! // Object[] element = (Object[]) iter.next(); ! // System.out.println(element[0]); ! // System.out.println(element[1]); ! // } ! } public void testErrorOnCompletions() throws IOException, CoreException { String str = "import math; class C dsdfas d not valid\n"; ! List list = shell.getTokenCompletions("math", str); assertEquals(1, list.size()); Object object[] = (Object[]) list.get(0); ! assertEquals("ERROR_COMPLETING", object[0]); ! } ! public void testOther() { ! String str = getTestStr(); + List list = shell.getClassCompletions("C", str); + assertEquals(18, list.size()); ! list = shell.getTokenCompletions("C", str); ! assertEquals(17, list.size()); ! // for (Iterator iter = list.iterator(); iter.hasNext();) { ! // Object[] element = (Object[]) iter.next(); ! // System.out.println(element[0]); ! // System.out.println(element[1]); ! // } ! } ! ! /** ! * @return ! */ ! private String getTestStr() { ! String str = "class C(object): \n" ! + " \n" + " def __init__(self): \n" ! + " print dir(self) \n" + " \n" ! + " def a(self): \n" + " pass \n" ! + " \n" + " \n" ! + " def b(self): \n" + " self.c=1 \n" ! + " pass \n"; ! return str; ! } ! } \ No newline at end of file --- NEW FILE: GeneralTests.java --- /* * Created on Sep 17, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.codecompletion; import junit.framework.TestCase; /** * @author Fabio Zadrozny */ public class GeneralTests extends TestCase{ public void testIt() { String string = "from scbr import ddd #tetet"; System.out.println(string.replaceAll("#.*", "")); } public static void main(String[] args) { junit.textui.TestRunner.run(GeneralTests.class); } } |