1 33 34 package edu.rice.cs.drjava.model.definitions.reducedmodel; 35 36 import edu.rice.cs.drjava.DrJavaTestCase; 37 38 42 public final class GapTest extends DrJavaTestCase { 43 46 public void testGrow() { 47 Gap gap0 = new Gap(0, ReducedToken.FREE); 48 Gap gap1 = new Gap(1, ReducedToken.FREE); 49 gap0.grow(5); 50 assertEquals(5, gap0.getSize()); 51 gap0.grow(0); 52 assertEquals(5, gap0.getSize()); 53 gap1.grow(-6); 54 assertEquals(1, gap1.getSize()); 55 } 56 57 60 public void testShrink() { 61 Gap gap0 = new Gap(5, ReducedToken.FREE); 62 Gap gap1 = new Gap(1, ReducedToken.FREE); 63 gap0.shrink(3); 64 assertEquals(2, gap0.getSize()); 65 gap0.shrink(0); 66 assertEquals(2, gap0.getSize()); 67 gap1.shrink(3); 68 assertEquals(1, gap1.getSize()); 69 gap1.shrink(-1); 70 assertEquals(1, gap1.getSize()); 71 } 72 } 73 74 75 76 | Popular Tags |