edu.rice.cs.drjava.model.definitions.reducedmodel
Class SingleQuoteTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by edu.rice.cs.drjava.DrJavaTestCase
              extended by edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
                  extended by edu.rice.cs.drjava.model.definitions.reducedmodel.SingleQuoteTest
All Implemented Interfaces:
ReducedModelStates, Test

public final class SingleQuoteTest
extends BraceReductionTestCase
implements ReducedModelStates

Tests the interaction between quotes and backslashes.

Version:
$Id: SingleQuoteTest.java 4653 2008-08-26 14:46:35Z rcartwright $

Field Summary
 
Fields inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
model0, model1, model2
 
Fields inherited from class edu.rice.cs.drjava.DrJavaTestCase
TEST_DRJAVA_CONFIG_PROPERTY
 
Fields inherited from interface edu.rice.cs.drjava.model.definitions.reducedmodel.ReducedModelStates
FREE, INSIDE_BLOCK_COMMENT, INSIDE_DOUBLE_QUOTE, INSIDE_LINE_COMMENT, INSIDE_SINGLE_QUOTE, STUTTER
 
Constructor Summary
SingleQuoteTest()
           
 
Method Summary
 void testBackSlashBeforeDoubleEscape()
          Tests the case when a backslash is inserted before two backslashes.
 void testChainEffect()
          Tests cases where a long chain of backslashes and quotes can be all altered with a simple insertion or deletion of a special character.
 void testDeleteAndCombine()
          Tests the case where deletion combines a backslash and a quote or two backslashes.
 void testDeleteAndCombine2()
          Tests more of the same sort of cases as found in testDeleteAndCombine().
 void testDeleteAndCombine3()
          More of the same sort of cases as found in testDeleteAndCombine().
 void testInsertBetweenDoubleEscape()
          Tests the case where a backslash breaks up two backslashes together.
 void testInsideQuoteNext()
          Tests the relationship between backslashes and quotes.
 void testInsideQuotePrevious()
          Tests the relationship between backslash characters and quote characters.
 
Methods inherited from class edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
insertGap, setUp
 
Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase
setConfigSetting, setDocText, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleQuoteTest

public SingleQuoteTest()
Method Detail

testInsideQuotePrevious

public void testInsideQuotePrevious()
Tests the relationship between backslash characters and quote characters. It focuses on the case where the backslash is inserted first before the quote.


testInsideQuoteNext

public void testInsideQuoteNext()
Tests the relationship between backslashes and quotes. Focuses on the case where a backslash is inserted and turns a regular quote into an escaped quote.


testBackSlashBeforeDoubleEscape

public void testBackSlashBeforeDoubleEscape()
Tests the case when a backslash is inserted before two backslashes. The existing double escape is broken and the first two backslashes become a double escape with the third backslash ending up alone.


testInsertBetweenDoubleEscape

public void testInsertBetweenDoubleEscape()
Tests the case where a backslash breaks up two backslashes together. The newly inserted backslash and the first backslash form a new double escape and the second backslash in the previous double escape becomes free.


testDeleteAndCombine

public void testDeleteAndCombine()
Tests the case where deletion combines a backslash and a quote or two backslashes. The deletion of characters in between the two special characters brings them together and unites them into a 2-character special token.


testDeleteAndCombine2

public void testDeleteAndCombine2()
Tests more of the same sort of cases as found in testDeleteAndCombine().


testDeleteAndCombine3

public void testDeleteAndCombine3()
More of the same sort of cases as found in testDeleteAndCombine().


testChainEffect

public void testChainEffect()
Tests cases where a long chain of backslashes and quotes can be all altered with a simple insertion or deletion of a special character.