|
From: Christopher W. <caw...@us...> - 2006-02-10 20:00:07
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13520/src/org/rubypeople/rdt/internal/formatter Modified Files: TC_CodeFormatter.java FormatTestData.xml Log Message: try to fix tests to run with new code changes Index: FormatTestData.xml =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FormatTestData.xml 18 Jan 2005 22:15:19 -0000 1.3 --- FormatTestData.xml 10 Feb 2006 19:59:55 -0000 1.4 *************** *** 18,28 **** <formatted> class xx ! **def xx() ! ****if bla() then ! ******bla ! ****else ! ******arg ! ****end ! **end end </formatted> --- 18,28 ---- <formatted> class xx ! def xx() ! if bla() then ! bla ! else ! arg ! end ! end end </formatted> *************** *** 44,54 **** <formatted> if(true) ! **while(true)do ! ****if/test/=~"test" then ! ******puts "TEST MATCHES" ; ! ****elsif/test/=~"abc" ! ******puts "ABC MATCHES"; ! ****end ! **end end </formatted> --- 44,54 ---- <formatted> if(true) ! while(true)do ! if/test/=~"test" then ! puts "TEST MATCHES" ; ! elsif/test/=~"abc" ! puts "ABC MATCHES"; ! end ! end end </formatted> *************** *** 94,103 **** </unformatted> <formatted> ! *# comment ! *def firstMethod ! ***if a ! *****b ! ***end ! *end </formatted> </test> --- 94,103 ---- </unformatted> <formatted> ! # comment ! def firstMethod ! if a ! b ! end ! end </formatted> </test> *************** *** 115,121 **** <formatted> a.each { | x | ! **if a ! ****b ! **end } </formatted> --- 115,121 ---- <formatted> a.each { | x | ! if a ! b ! end } </formatted> *************** *** 132,136 **** a.each { | x | ! **test } </formatted> --- 132,136 ---- a.each { | x | ! test } </formatted> *************** *** 151,157 **** <formatted> begin ! **x rescue ! **y end </formatted> --- 151,157 ---- <formatted> begin ! x rescue ! y end </formatted> *************** *** 179,186 **** <formatted> while (a) do ! **test end x = 5 ; until x do ! **test end </formatted> --- 179,186 ---- <formatted> while (a) do ! test end x = 5 ; until x do ! test end </formatted> *************** *** 199,206 **** <formatted> 3.timeswhile do ! **test end while (a) x end ; 2.times do ! **test end </formatted> --- 199,206 ---- <formatted> 3.timeswhile do ! test end while (a) x end ; 2.times do ! test end </formatted> *************** *** 239,246 **** <formatted> a = 0 ; if a != 0 ! **test end a = if a != 0 ! **5 end </formatted> --- 239,246 ---- <formatted> a = 0 ; if a != 0 ! test end a = if a != 0 ! 5 end </formatted> *************** *** 257,261 **** <formatted> begin ! **i+=1 end until i == 5 test --- 257,261 ---- <formatted> begin ! i+=1 end until i == 5 test *************** *** 285,290 **** <formatted> class A ! **def a ! **end;end class B end; </formatted> --- 285,290 ---- <formatted> class A ! def a ! end;end class B end; </formatted> *************** *** 300,304 **** <formatted> def a;if 0 then puts "X" ! **end; end; </formatted> --- 300,304 ---- <formatted> def a;if 0 then puts "X" ! end; end; </formatted> *************** *** 318,322 **** <formatted> def x(a, b) ! **y end </formatted> --- 318,322 ---- <formatted> def x(a, b) ! y end </formatted> *************** *** 334,339 **** def x(a ! ******b) ! **x end </formatted> --- 334,339 ---- def x(a ! b) ! x end </formatted> *************** *** 349,354 **** <formatted> def x(a,b) ! **object.method(arg1, ! ****************arg2) end </formatted> --- 349,354 ---- <formatted> def x(a,b) ! object.method(arg1, ! arg2) end </formatted> *************** *** 371,382 **** </unformatted> <formatted> ! *puts "def x(a, b)" ! *puts "" ! *if a ! ***b ! *end ! *puts "if{" ! *b ! *puts "end" </formatted> </part> --- 371,382 ---- </unformatted> <formatted> ! puts "def x(a, b)" ! puts "" ! if a ! b ! end ! puts "if{" ! b ! puts "end" </formatted> </part> *************** *** 391,398 **** </unformatted> <formatted> ! *puts "Bla class" ! *puts "def method" ! *puts "end" </formatted> </part> --- 391,398 ---- </unformatted> <formatted> ! puts "Bla class" ! puts "def method" ! puts "end" </formatted> </part> *************** *** 408,416 **** </unformatted> <formatted> ! *puts "\"{" ! *puts "xx" ! *puts "class \\" ! *if ! ***b </formatted> </part> --- 408,416 ---- </unformatted> <formatted> ! puts "\"{" ! puts "xx" ! puts "class \\" ! if ! b </formatted> </part> *************** *** 424,430 **** </unformatted> <formatted> ! *puts 'def x(a, b)' ! *puts 'if{' ! *puts 'end' </formatted> </part> --- 424,430 ---- </unformatted> <formatted> ! puts 'def x(a, b)' ! puts 'if{' ! puts 'end' </formatted> </part> *************** *** 439,443 **** <formatted> if $' ! **o.m end </formatted> --- 439,443 ---- <formatted> if $' ! o.m end </formatted> *************** *** 452,458 **** </unformatted> <formatted> ! *puts '"def" if x(a, b)' ! *puts 'if{' ! *puts 'end' </formatted> </part> --- 452,458 ---- </unformatted> <formatted> ! puts '"def" if x(a, b)' ! puts 'if{' ! puts 'end' </formatted> </part> *************** *** 476,480 **** =end if ! **b end </formatted> --- 476,480 ---- =end if ! b end </formatted> *************** *** 533,537 **** v =~ / { \/ { \\/ if ! **o.m() end v =~ /{/ --- 533,537 ---- v =~ / { \/ { \\/ if ! o.m() end v =~ /{/ *************** *** 555,560 **** <formatted> if /abc ! **/ =~ "\ndef" then ! **puts 'matched def' ; end </formatted> --- 555,560 ---- <formatted> if /abc ! / =~ "\ndef" then ! puts 'matched def' ; end </formatted> *************** *** 575,583 **** <formatted> def a ! **if true ! ****1/2 ! **else ! ****1/4 ! **end end </formatted> --- 575,583 ---- <formatted> def a ! if true ! 1/2 ! else ! 1/4 ! end end </formatted> *************** *** 605,609 **** puts %Q{ def class #{class} { if } class} if ! **puts "" </formatted> </part> --- 605,609 ---- puts %Q{ def class #{class} { if } class} if ! puts "" </formatted> </part> Index: TC_CodeFormatter.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TC_CodeFormatter.java 2 Jun 2004 21:58:41 -0000 1.3 --- TC_CodeFormatter.java 10 Feb 2006 19:59:55 -0000 1.4 *************** *** 9,13 **** import javax.xml.parsers.ParserConfigurationException; ! import org.rubypeople.rdt.internal.formatter.CodeFormatter; import org.w3c.dom.Document; import org.w3c.dom.Node; --- 9,15 ---- import javax.xml.parsers.ParserConfigurationException; ! import junit.framework.Assert; ! import junit.framework.TestCase; ! import org.w3c.dom.Document; import org.w3c.dom.Node; *************** *** 15,21 **** import org.xml.sax.SAXException; - import junit.framework.Assert; - import junit.framework.TestCase; - public class TC_CodeFormatter extends TestCase { --- 17,20 ---- *************** *** 84,89 **** ArrayList partList = (ArrayList) testMap.get(name); for (int i = 0; i < partList.size(); i++) { ! TestData data = (TestData) partList.get(i); ! String formatted = new CodeFormatter('*', true).formatString(data.unformattedText); System.out.println("---------- " + data.assertionMessage + " --------") ; System.out.println(data.unformattedText) ; --- 83,88 ---- ArrayList partList = (ArrayList) testMap.get(name); for (int i = 0; i < partList.size(); i++) { ! TestData data = (TestData) partList.get(i); ! String formatted = new OldCodeFormatter().formatString(data.unformattedText); System.out.println("---------- " + data.assertionMessage + " --------") ; System.out.println(data.unformattedText) ; |