1 33 34 package edu.rice.cs.drjava.model.definitions.indent; 35 36 import javax.swing.text.BadLocationException ; 37 38 42 public final class ActionDoNothingTest extends IndentRulesTestCase { 43 44 45 48 public void testEmptyString() throws BadLocationException { 49 IndentRuleAction rule = new ActionDoNothing(); 50 String text = ""; 51 52 _setDocText(text); 53 rule.indentLine(_doc, 0, Indenter.OTHER); 54 _assertContents(text); 55 } 56 57 60 public void testNoLeadingSpaces() throws BadLocationException { 61 IndentRuleAction rule = new ActionDoNothing(); 62 String text = "foo();\nbar();"; 63 64 _setDocText(text); 66 rule.indentLine(_doc, 0, Indenter.OTHER); 67 _assertContents(text); 68 69 rule.indentLine(_doc, 9, Indenter.OTHER); 71 _assertContents(text); 72 } 73 74 77 public void testLeadingSpaces() throws BadLocationException { 78 IndentRuleAction rule = new ActionDoNothing(); 79 String text = " foo();\n bar();"; 80 81 _setDocText(text); 83 rule.indentLine(_doc, 0, Indenter.OTHER); 84 _assertContents(text); 85 86 rule.indentLine(_doc, 10, Indenter.OTHER); 88 _assertContents(text); 89 } 90 91 } 92 | Popular Tags |