Example #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]"));
 }
Example #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]"));
 }
Example #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));
 }
Example #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]"));
 }
Example #5
0
 @Test
 public void testSingle() {
   Collection<InputRange> start = Arrays.asList(InputRange.make('a', 'b'));
   assertThat(new InputRangeCleanup().cleanUp(start), is(start));
 }