Search in sources :

Example 1 with Arguments

use of com.yahoo.searchlib.rankingexpression.rule.Arguments in project vespa by vespa-engine.

the class ReferenceTestCase method testToString.

@Test
public void testToString() {
    assertEquals("foo(arg_1)", new Reference("foo", new Arguments(new ReferenceNode("arg_1")), null).toString());
    assertEquals("foo(arg_1).out", new Reference("foo", new Arguments(new ReferenceNode("arg_1")), "out").toString());
    assertEquals("foo(arg_1).out", new Reference("foo", new Arguments(new NameNode("arg_1")), "out").toString());
    assertEquals("foo", new Reference("foo", new Arguments(), null).toString());
}
Also used : NameNode(com.yahoo.searchlib.rankingexpression.rule.NameNode) ReferenceNode(com.yahoo.searchlib.rankingexpression.rule.ReferenceNode) Arguments(com.yahoo.searchlib.rankingexpression.rule.Arguments) Test(org.junit.Test)

Example 2 with Arguments

use of com.yahoo.searchlib.rankingexpression.rule.Arguments in project vespa by vespa-engine.

the class ReferenceTestCase method testSimple.

@Test
public void testSimple() {
    assertTrue(new Reference("foo", new Arguments(new ReferenceNode("arg")), null).isSimple());
    assertTrue(new Reference("foo", new Arguments(new ReferenceNode("arg")), "out").isSimple());
    assertTrue(new Reference("foo", new Arguments(new NameNode("arg")), "out").isSimple());
    assertFalse(new Reference("foo", new Arguments(), null).isSimple());
}
Also used : NameNode(com.yahoo.searchlib.rankingexpression.rule.NameNode) ReferenceNode(com.yahoo.searchlib.rankingexpression.rule.ReferenceNode) Arguments(com.yahoo.searchlib.rankingexpression.rule.Arguments) Test(org.junit.Test)

Aggregations

Arguments (com.yahoo.searchlib.rankingexpression.rule.Arguments)2 NameNode (com.yahoo.searchlib.rankingexpression.rule.NameNode)2 ReferenceNode (com.yahoo.searchlib.rankingexpression.rule.ReferenceNode)2 Test (org.junit.Test)2