[Pydev-cvs] org.python.pydev.parser/tests/org/python/pydev/parser/visitors ParsingUtilsTest.java,
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-06-15 16:46:08
|
Update of /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/visitors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2515/tests/org/python/pydev/parser/visitors Modified Files: ParsingUtilsTest.java Log Message: Minors: ParsingUtils accepts null instead of buffer (so, objects that don't need the actual values can just use it to skip comments, parenthesis, etc). Index: ParsingUtilsTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/visitors/ParsingUtilsTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ParsingUtilsTest.java 25 Feb 2006 00:12:51 -0000 1.3 --- ParsingUtilsTest.java 15 Jun 2008 16:46:15 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- import org.python.pydev.core.docutils.ParsingUtils; + import org.python.pydev.core.structure.FastStringBuffer; import junit.framework.TestCase; *************** *** 24,28 **** public void testRemoveCommentsAndWhitespaces() { String s = "a , b = 0,#ignore\n*args, **kwargs"; ! StringBuffer buf = new StringBuffer(s); ParsingUtils.removeCommentsAndWhitespaces(buf); assertEquals("a,b=0,*args,**kwargs", buf.toString()); --- 25,29 ---- public void testRemoveCommentsAndWhitespaces() { String s = "a , b = 0,#ignore\n*args, **kwargs"; ! FastStringBuffer buf = new FastStringBuffer(s, 0); ParsingUtils.removeCommentsAndWhitespaces(buf); assertEquals("a,b=0,*args,**kwargs", buf.toString()); *************** *** 34,38 **** "*args, **kwargs\n" + "'''"; ! StringBuffer buf = new StringBuffer(s); ParsingUtils.removeCommentsWhitespacesAndLiterals(buf); assertEquals("a,b=0,*args,**kwargs", buf.toString()); --- 35,39 ---- "*args, **kwargs\n" + "'''"; ! FastStringBuffer buf = new FastStringBuffer(s, 0); ParsingUtils.removeCommentsWhitespacesAndLiterals(buf); assertEquals("a,b=0,*args,**kwargs", buf.toString()); *************** *** 42,46 **** "*args, **kwargs\n" + "'''remove'\""; ! buf = new StringBuffer(s); ParsingUtils.removeCommentsWhitespacesAndLiterals(buf); assertEquals("a,b=0,*args,**kwargs", buf.toString()); --- 43,47 ---- "*args, **kwargs\n" + "'''remove'\""; ! buf = new FastStringBuffer(s, 0); ParsingUtils.removeCommentsWhitespacesAndLiterals(buf); assertEquals("a,b=0,*args,**kwargs", buf.toString()); *************** *** 50,54 **** "*args, **kwargs\n" + "'''remove'''keep"; ! buf = new StringBuffer(s); ParsingUtils.removeCommentsWhitespacesAndLiterals(buf); assertEquals("a,b=0,*args,**kwargskeep", buf.toString()); --- 51,55 ---- "*args, **kwargs\n" + "'''remove'''keep"; ! buf = new FastStringBuffer(s, 0); ParsingUtils.removeCommentsWhitespacesAndLiterals(buf); assertEquals("a,b=0,*args,**kwargskeep", buf.toString()); |