示例#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));
 }