|
From: <caw...@us...> - 2007-02-23 14:37:43
|
Revision: 2008
http://svn.sourceforge.net/rubyeclipse/?rev=2008&view=rev
Author: cawilliams
Date: 2007-02-23 06:37:40 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
fix broken test (the ugly way - I made a class public to test it. We may want to see if there's anyway to test this from the APIU of a RubyEditor)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/rubyeditor/TC_TabConverter.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java 2007-02-23 11:33:06 UTC (rev 2007)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java 2007-02-23 14:37:40 UTC (rev 2008)
@@ -1518,7 +1518,7 @@
void customizeDocumentCommand(IDocument document, DocumentCommand command);
}
- static class TabConverter implements ITextConverter {
+ public static class TabConverter implements ITextConverter {
private int fTabRatio;
private ILineTracker fLineTracker;
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/rubyeditor/TC_TabConverter.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/rubyeditor/TC_TabConverter.java 2007-02-23 11:33:06 UTC (rev 2007)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/rubyeditor/TC_TabConverter.java 2007-02-23 14:37:40 UTC (rev 2008)
@@ -2,6 +2,7 @@
import junit.framework.TestCase;
+import org.eclipse.jface.text.DefaultLineTracker;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.DocumentCommand;
import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor.TabConverter;
@@ -55,11 +56,16 @@
TestDocumentCommand command = new TestDocumentCommand(currentOffset);
command.text = "\t";
Document document = new Document(TEST_TEXT);
+ DefaultLineTracker tracker = new DefaultLineTracker();
+ converter.setLineTracker(tracker);
converter.customizeDocumentCommand(document, command);
String message = "Offset = "+currentOffset + "; tabWidth = "+spacesPerTab;
- assertEquals(message, " ".substring(0,expectedCountOfTabs), command.text);
+ if (spacesPerTab == 0)
+ assertEquals(message, "", command.text);
+ else
+ assertEquals(message, " ".substring(0,expectedCountOfTabs), command.text);
// assertEquals("Full indent (" + spacesPerTab + ")", " ".substring(0,spacesPerTab), expander.getFullIndent());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|