Examples of complement()


Examples of org.antlr.misc.IntervalSet.complement()

  @Test public void testNotSetEdgeElement() throws Exception {
    IntervalSet vocabulary = IntervalSet.of(1,2);
    IntervalSet s = IntervalSet.of(1);
    String expecting = "2";
    String result = (s.complement(vocabulary)).toString();
    assertEquals(result, expecting);
  }

    @Test public void testNotSetFragmentedVocabulary() throws Exception {
        IntervalSet vocabulary = IntervalSet.of(1,255);
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

        IntervalSet s = IntervalSet.of(50,60);
        s.add(3);
        s.add(250,300);
        s.add(10000); // this is outside range of vocab and should be ignored
        String expecting = "{1..2, 4..49, 61..249, 1000..2000, 9999}";
        String result = (s.complement(vocabulary)).toString();
        assertEquals(result, expecting);
    }

    @Test public void testSubtractOfCompletelyContainedRange() throws Exception {
        IntervalSet s = IntervalSet.of(10,20);
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

  @Test public void testComplement3() throws Exception {
    IntervalSet s = IntervalSet.of(1,96);
    s.add(99,Label.MAX_CHAR_VALUE);
    String expecting = "97..98";
    String result = (s.complement(1,Label.MAX_CHAR_VALUE)).toString();
    assertEquals(result, expecting);
  }

    @Test public void testMergeOfRangesAndSingleValues() throws Exception {
        // {0..41, 42, 43..65534}
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

    @Test public void testNotSingleElement() throws Exception {
        IntervalSet vocabulary = IntervalSet.of(1,1000);
        vocabulary.add(2000,3000);
        IntervalSet s = IntervalSet.of(50,50);
        String expecting = "{1..49, 51..1000, 2000..3000}";
        String result = (s.complement(vocabulary)).toString();
        assertEquals(result, expecting);
    }

  @Test public void testNotSet() throws Exception {
    IntervalSet vocabulary = IntervalSet.of(1,1000);
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

    IntervalSet vocabulary = IntervalSet.of(1,1000);
    IntervalSet s = IntervalSet.of(50,60);
    s.add(5);
    s.add(250,300);
    String expecting = "{1..4, 6..49, 61..249, 301..1000}";
    String result = (s.complement(vocabulary)).toString();
    assertEquals(result, expecting);
  }

  @Test public void testNotEqualSet() throws Exception {
    IntervalSet vocabulary = IntervalSet.of(1,1000);
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

  @Test public void testNotEqualSet() throws Exception {
    IntervalSet vocabulary = IntervalSet.of(1,1000);
    IntervalSet s = IntervalSet.of(1,1000);
    String expecting = "{}";
    String result = (s.complement(vocabulary)).toString();
    assertEquals(result, expecting);
  }

  @Test public void testNotSetEdgeElement() throws Exception {
    IntervalSet vocabulary = IntervalSet.of(1,2);
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

  @Test public void testNotSetEdgeElement() throws Exception {
    IntervalSet vocabulary = IntervalSet.of(1,2);
    IntervalSet s = IntervalSet.of(1);
    String expecting = "2";
    String result = (s.complement(vocabulary)).toString();
    assertEquals(result, expecting);
  }

    @Test public void testNotSetFragmentedVocabulary() throws Exception {
        IntervalSet vocabulary = IntervalSet.of(1,255);
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

        IntervalSet s = IntervalSet.of(50,60);
        s.add(3);
        s.add(250,300);
        s.add(10000); // this is outside range of vocab and should be ignored
        String expecting = "{1..2, 4..49, 61..249, 1000..2000, 9999}";
        String result = (s.complement(vocabulary)).toString();
        assertEquals(result, expecting);
    }

    @Test public void testSubtractOfCompletelyContainedRange() throws Exception {
        IntervalSet s = IntervalSet.of(10,20);
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

  @Test public void testComplement3() throws Exception {
    IntervalSet s = IntervalSet.of(1,96);
    s.add(99,Label.MAX_CHAR_VALUE);
    String expecting = "97..98";
    String result = (s.complement(1,Label.MAX_CHAR_VALUE)).toString();
    assertEquals(result, expecting);
  }

    @Test public void testMergeOfRangesAndSingleValues() throws Exception {
        // {0..41, 42, 43..65534}
View Full Code Here

Examples of org.antlr.misc.IntervalSet.complement()

    public void testNotSingleElement() throws Exception {
        IntervalSet vocabulary = IntervalSet.of(1,1000);
        vocabulary.add(2000,3000);
        IntervalSet s = IntervalSet.of(50,50);
        String expecting = "{1..49, 51..1000, 2000..3000}";
        String result = (s.complement(vocabulary)).toString();
        assertEquals(result, expecting);
    }

  public void testNotSet() throws Exception {
    IntervalSet vocabulary = IntervalSet.of(1,1000);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.