예제 #1
0
 @Test
 public void testAny() {
   List<InputRange> start = Arrays.asList(InputRange.ANY, InputRange.make('b', 'd'));
   assertThat(new InputRangeCleanup().cleanUp(start).toString(), is("[0x0-a, b-d, e-0xffff]"));
 }
예제 #2
0
 @Test
 public void testEnclosing() {
   List<InputRange> start = Arrays.asList(InputRange.make('a', 'g'), InputRange.make('b', 'd'));
   assertThat(new InputRangeCleanup().cleanUp(start).toString(), is("[a-a, b-d, e-g]"));
 }
예제 #3
0
 @Test
 public void testNonIntersecting() {
   List<InputRange> start = Arrays.asList(InputRange.make('a', 'b'), InputRange.make('c', 'd'));
   assertThat(new InputRangeCleanup().cleanUp(start), is(start));
 }
예제 #4
0
 @Test
 public void testSimpleIntersecting() {
   List<InputRange> start = Arrays.asList(InputRange.make('a', 'c'), InputRange.make('c', 'd'));
   assertThat(new InputRangeCleanup().cleanUp(start).toString(), is("[a-b, c-c, d-d]"));
 }
예제 #5
0
 @Test
 public void testSingle() {
   Collection<InputRange> start = Arrays.asList(InputRange.make('a', 'b'));
   assertThat(new InputRangeCleanup().cleanUp(start), is(start));
 }