edu.rice.cs.drjava.model.definitions.reducedmodel
Class BackSlashTest
java.lang.Object
|
+--junit.framework.Assert
|
+--junit.framework.TestCase
|
+--edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
|
+--edu.rice.cs.drjava.model.definitions.reducedmodel.BackSlashTest
- All Implemented Interfaces:
- ReducedModelStates, Test
- public class BackSlashTest
- extends BraceReductionTestCase
- implements ReducedModelStates
Test the interactions between double quotes and backslashes.
- Version:
- $Id: BackSlashTest.java,v 1.16 2002/02/08 14:22:21 brianstoler Exp $
Method Summary |
protected void |
insertGap(BraceReduction model,
int size)
Convenience function to insert a number of non-special characters into a reduced model. |
protected void |
setUp()
Initializes the reduced models used in the tests. |
static Test |
suite()
Creates a test suite for JUnit to use. |
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 junit.framework.TestCase |
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
model0
protected ReducedModelControl model0
model1
protected ReducedModelControl model1
model2
protected ReducedModelControl model2
BackSlashTest
public BackSlashTest(String name)
- Constructor.
- Parameters:
name
- a name for the test.
setUp
protected void setUp()
- Initializes the reduced models used in the tests.
- Overrides:
setUp
in class TestCase
suite
public static Test suite()
- Creates a test suite for JUnit to use.
- Returns:
- a test suite for JUnit
insertGap
protected void insertGap(BraceReduction model,
int size)
- Convenience function to insert a number of non-special characters into a reduced model.
- Parameters:
model
- the model being modifiedsize
- the number of characters being inserted
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.