From: <mir...@us...> - 2006-09-17 00:02:31
|
Revision: 1614 http://svn.sourceforge.net/rubyeclipse/?rev=1614&view=rev Author: mirkostocker Date: 2006-09-16 17:02:25 -0700 (Sat, 16 Sep 2006) Log Message: ----------- tests for the new DocumentationCommentRule Modified Paths: -------------- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java 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 2006-09-17 00:01:21 UTC (rev 1613) +++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java 2006-09-17 00:02:25 UTC (rev 1614) @@ -38,14 +38,22 @@ assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 6)); } - + public void testMultilineComment() { String source = "=begin\nComment\n=end"; assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, 0)); assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, 10)); - } - + + source = "=begin\n"+ + " for multiline comments, the =begin and =end must\n" + + " appear in the first column\n" + + "=end"; + assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, 0)); + assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, source.length() / 2)); + assertEquals(RubyPartitionScanner.RUBY_MULTI_LINE_COMMENT, this.getContentType(source, source.length() - 1)); + } + public void testMultilineCommentNotOnFirstColumn() { String source = " =begin\nComment\n=end"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |