|
From: <caw...@us...> - 2007-07-24 14:54:20
|
Revision: 2828
http://svn.sourceforge.net/rubyeclipse/?rev=2828&view=rev
Author: cawilliams
Date: 2007-07-24 07:54:05 -0700 (Tue, 24 Jul 2007)
Log Message:
-----------
fix #5259 - add test and make formatter match indentation that editor uses for case/when statements. Indent the whens!
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml 2007-07-24 14:53:57 UTC (rev 2827)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/FormatTestData.xml 2007-07-24 14:54:05 UTC (rev 2828)
@@ -694,5 +694,33 @@
</part>
</test>
+<test ID="CaseWithWhens">
+<part>
+<assertionMessage>Indent when</assertionMessage>
+<unformatted>
+module Foo
+ def bar
+ case baz
+ when 'sweet harmonious biscuits'
+when 'yuck'
+ when 'eww'
+ end
+ end
+end
+</unformatted>
+<formatted>
+module Foo
+ def bar
+ case baz
+ when 'sweet harmonious biscuits'
+ when 'yuck'
+ when 'eww'
+ end
+ end
+end
+</formatted>
+</part>
+</test>
+
</tests>
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-07-24 14:53:57 UTC (rev 2827)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-07-24 14:54:05 UTC (rev 2828)
@@ -140,4 +140,8 @@
doTest("LineStartingWithParen");
}
+ public void testCaseWithWhens() {
+ doTest("CaseWithWhens");
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|