예제 #1
0
 /** Test of toString method, of class SkipWords. */
 @Test
 public void testToString() {
   System.out.println("toString");
   SkipWords instance = new SkipWords(0, Integer.MAX_VALUE);
   String expResult = "words(,)";
   String result = instance.toString();
   assertEquals(expResult, result);
 }
예제 #2
0
 /** Test of copy method, of class SkipWords. */
 @Test
 public void testCopy() {
   System.out.println("copy");
   SkipWords instance = new SkipWords(0, 7);
   TypeExpr expResult = instance;
   TypeExpr result = instance.copy();
   assertEquals(expResult, result);
 }
예제 #3
0
 /** Test of getQuery method, of class SkipWords. */
 @Test
 public void testGetQuery() {
   System.out.println("getQuery");
   SrlQuery query = new SrlQuery();
   SrlQuery expResult = new SrlQuery();
   expResult.query.append("\" \"");
   SkipWords instance = new SkipWords(0, 10);
   instance.getQuery(query);
   assertEquals(expResult, query);
 }
예제 #4
0
 /** Test of matches method, of class SkipWords. */
 @Test
 public void testMatches() {
   System.out.println("matches");
   Token token = new Token("literal", 0, 7);
   int no = 0;
   Stack<MatchFork> stack = new Stack<MatchFork>();
   List<Token> lookBackStack = new LinkedList<Token>();
   SkipWords instance = new SkipWords(0, 1);
   TypeExpr expResult = new DummyNode();
   instance.setNext(expResult);
   TypeExpr result = instance.matches(token, no, stack, lookBackStack);
   assertEquals(expResult, result);
   assertTrue(!stack.isEmpty());
 }
예제 #5
0
  /** Test of canEnd method, of class SkipWords. */
  @Test
  public void testCanEnd() {
    System.out.println("canEnd");
    SkipWords instance = new SkipWords(0, 1);
    instance.setNext(new DummyNode());
    boolean expResult = true;
    boolean result = instance.canEnd();
    assertEquals(expResult, result);

    instance = new SkipWords(1, 2);
    instance.setNext(new DummyNode());
    expResult = false;
    result = instance.canEnd();
    assertEquals(expResult, result);
  }