edu.rice.cs.drjava.model.definitions.reducedmodel
Class MixedQuoteTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
edu.rice.cs.drjava.DrJavaTestCase
edu.rice.cs.drjava.model.definitions.reducedmodel.BraceReductionTestCase
edu.rice.cs.drjava.model.definitions.reducedmodel.MixedQuoteTest
- All Implemented Interfaces:
- ReducedModelStates, Test
public final class MixedQuoteTest
- extends BraceReductionTestCase
- implements ReducedModelStates
Tests the interaction between double and single quotes and comments
- Version:
- $Id: MixedQuoteTest.java 4653 2008-08-26 14:46:35Z rcartwright $
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 |
testDoubleEclipsesSingle()
Tests how a double quote can eclipse the effects of a single quote by inserting
the double quote before the single quote. |
void |
testSingleEclipsesDouble()
Tests how a single quote can eclipse the effects of a double quote by inserting
the single quote before the double quote. |
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 |
_model
protected ReducedModelControl _model
MixedQuoteTest
public MixedQuoteTest()
setUp
protected void setUp()
throws Exception
- Initializes the reduced models used in the tests.
- Overrides:
setUp
in class BraceReductionTestCase
- Throws:
Exception
- This convention is mandated by JUnit.TestCase, the superclass of this class.
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.
- Overrides:
insertGap
in class BraceReductionTestCase
- Parameters:
model
- the model being modifiedsize
- the number of characters being inserted
testSingleEclipsesDouble
public void testSingleEclipsesDouble()
- Tests how a single quote can eclipse the effects of a double quote by inserting
the single quote before the double quote. This test caught an error with
getStateAtCurrent(): the check for double quote status checks if there is a double
quote immediately preceding, but it didn't make sure the double quote was FREE.
I fixed that, so now the test passes.
testDoubleEclipsesSingle
public void testDoubleEclipsesSingle()
- Tests how a double quote can eclipse the effects of a single quote by inserting
the double quote before the single quote.