|
From: <caw...@us...> - 2007-05-16 16:37:46
|
Revision: 2489
http://svn.sourceforge.net/rubyeclipse/?rev=2489&view=rev
Author: cawilliams
Date: 2007-05-16 09:37:33 -0700 (Wed, 16 May 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TS_InternalUiText.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScannerTest.java
Deleted: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScannerTest.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScannerTest.java 2007-05-16 15:58:44 UTC (rev 2488)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScannerTest.java 2007-05-16 16:37:33 UTC (rev 2489)
@@ -1,47 +0,0 @@
-package org.rubypeople.rdt.internal.ui.text;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-// FIXME Integrate this with already existing PartitionScanner tests
-public class RubyPartitionScannerTest extends TestCase {
-
- private RubyPartitionScanner scanner;
-
- protected void setUp() throws Exception {
- super.setUp();
- scanner = new RubyPartitionScanner();
- }
-
- private void setDocument(String text) {
- IDocument document = new Document(text);
- scanner.setRange(document, 0, document.getLength());
- }
-
- public void testSingleLineComment() {
- setDocument("# comment");
-// assertEquals(IRubyPartitions.RUBY_SINGLE_LINE_COMMENT, scanner
-// .nextToken().getData());
- assertNull(scanner.nextToken().getData()); // comments are default partition now
- }
-
- public void testMultiLineComment() {
- setDocument("=begin\nSome comment text\n=end\n");
- assertEquals(IRubyPartitions.RUBY_MULTI_LINE_COMMENT, scanner
- .nextToken().getData());
- }
-
- public void testMultiLineCommentMustStartAtFirstColumn() {
- setDocument(" =begin\nSome comment text\n=end\n");
- assertFalse(IRubyPartitions.RUBY_MULTI_LINE_COMMENT.equals(scanner
- .nextToken().getData()));
- assertNull(scanner.nextToken().getData());
- }
-
- public void testPoundCharacterIsntAComment() {
- setDocument("?#");
- assertNull(scanner.nextToken().getData());
- }
-
-}
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java 2007-05-16 15:58:44 UTC (rev 2488)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java 2007-05-16 16:37:33 UTC (rev 2489)
@@ -95,4 +95,17 @@
assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 2));
assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(source, 5));
}
+
+ public void testPoundCharacterIsntAComment() {
+ String source = "?#";
+ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 1));
+ }
+
+ public void testSinglelineCommentJustAfterMultilineComment() {
+ String source = "=begin\nComment\n=end\n# this is a singleline comment\n";
+
+ assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, 0));
+ assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, 10));
+ assertEquals(RubyPartitionScanner.RUBY_SINGLE_LINE_COMMENT, this.getContentType(source, source.length() - 5));
+ }
}
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TS_InternalUiText.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TS_InternalUiText.java 2007-05-16 15:58:44 UTC (rev 2488)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TS_InternalUiText.java 2007-05-16 16:37:33 UTC (rev 2489)
@@ -9,7 +9,6 @@
public static Test suite() {
TestSuite suite = new TestSuite("org.rubypeople.rdt.internal.ui.text");
suite.addTestSuite(TC_RubyPartitionScanner.class);
- suite.addTestSuite(RubyPartitionScannerTest.class);
suite.addTestSuite(TC_RubyWordFinder.class);
suite.addTestSuite(TC_RubyTokenScanner.class);
return suite;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|