Package synalp.commons.input.javacc

Source Code of synalp.commons.input.javacc.InputReaderTest

package synalp.commons.input.javacc;

import org.junit.Test;

import synalp.commons.semantics.DefaultLiteral;
import synalp.commons.unification.*;

import static org.junit.Assert.*;

/**
* @author Alexandre Denis
*/
public class InputReaderTest
{
  @Test
  @SuppressWarnings("javadoc")
  public void testLiteralRead1()
  {
    DefaultLiteral literal = DefaultLiteral.readLiteral("A:proper_q(?C CR CS)");
    assertNotNull(literal);
    assertEquals(literal.getLabel(), new FeatureConstant("A"));
    assertEquals(literal.getPredicate(), new FeatureConstant("proper_q"));
    assertEquals(literal.getArguments().size(), 3);
    assertEquals(literal.getArgument(0), new FeatureVariable("?C"));
    assertEquals(literal.getArgument(1), new FeatureConstant("CR"));
  }


  @Test
  @SuppressWarnings("javadoc")
  public void testLiteralRead2()
  {
    DefaultLiteral literal = DefaultLiteral.readLiteral("qeq(BR L3)");
    assertNotNull(literal);
    assertNull(literal.getLabel());
    assertEquals(literal.getPredicate(), new FeatureConstant("qeq"));
    assertEquals(literal.getArguments().size(), 2);
  }
}
TOP

Related Classes of synalp.commons.input.javacc.InputReaderTest

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.