Search in sources :

Example 1 with PreLanguageParser

use of plugin.pretokens.parser.PreLanguageParser in project pcgen by PCGen.

the class PreLanguageParserTest method testNot1LanguageOf2.

/**
	 * @throws Exception
	 */
@Test
public void testNot1LanguageOf2() throws Exception {
    PreLanguageParser parser = new PreLanguageParser();
    Prerequisite prereq = parser.parse("LANG", "1,Dwarven,Elven", true, false);
    System.out.println(prereq);
    assertEquals("<prereq operator=\"LT\" operand=\"1\" >\n" + "<prereq kind=\"lang\" count-multiples=\"true\" key=\"Dwarven\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"lang\" count-multiples=\"true\" key=\"Elven\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreLanguageParser(plugin.pretokens.parser.PreLanguageParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 2 with PreLanguageParser

use of plugin.pretokens.parser.PreLanguageParser in project pcgen by PCGen.

the class PreLanguageParserTest method testNot2LanguageOfAny.

/**
	 * @throws Exception
	 */
@Test
public void testNot2LanguageOfAny() throws Exception {
    PreLanguageParser parser = new PreLanguageParser();
    Prerequisite prereq = parser.parse("LANG", "2,ANY", true, false);
    System.out.println(prereq);
    assertEquals("<prereq kind=\"lang\" count-multiples=\"true\" key=\"ANY\" operator=\"LT\" operand=\"2\" >\n" + "</prereq>\n", prereq.toString());
}
Also used : PreLanguageParser(plugin.pretokens.parser.PreLanguageParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 3 with PreLanguageParser

use of plugin.pretokens.parser.PreLanguageParser in project pcgen by PCGen.

the class PreLanguageRoundRobin method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    TokenRegistration.register(new PreLanguageParser());
    TokenRegistration.register(new PreLanguageWriter());
}
Also used : PreLanguageWriter(plugin.pretokens.writer.PreLanguageWriter) PreLanguageParser(plugin.pretokens.parser.PreLanguageParser)

Example 4 with PreLanguageParser

use of plugin.pretokens.parser.PreLanguageParser in project pcgen by PCGen.

the class PreLanguageParserTest method test1LanguageOf2.

/**
	 * @throws Exception
	 */
@Test
public void test1LanguageOf2() throws Exception {
    PreLanguageParser parser = new PreLanguageParser();
    Prerequisite prereq = parser.parse("LANG", "1,Dwarven,Elven", false, false);
    System.out.println(prereq);
    assertEquals("<prereq operator=\"GTEQ\" operand=\"1\" >\n" + "<prereq kind=\"lang\" count-multiples=\"true\" key=\"Dwarven\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "<prereq kind=\"lang\" count-multiples=\"true\" key=\"Elven\" operator=\"GTEQ\" operand=\"1\" >\n" + "</prereq>\n" + "</prereq>\n", prereq.toString());
}
Also used : PreLanguageParser(plugin.pretokens.parser.PreLanguageParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Example 5 with PreLanguageParser

use of plugin.pretokens.parser.PreLanguageParser in project pcgen by PCGen.

the class PreLanguageParserTest method test2LanguageOfAny.

/**
	 * @throws Exception
	 */
@Test
public void test2LanguageOfAny() throws Exception {
    PreLanguageParser parser = new PreLanguageParser();
    Prerequisite prereq = parser.parse("LANG", "2,ANY", false, false);
    System.out.println(prereq);
    assertEquals("<prereq kind=\"lang\" count-multiples=\"true\" key=\"ANY\" operator=\"GTEQ\" operand=\"2\" >\n" + "</prereq>\n", prereq.toString());
}
Also used : PreLanguageParser(plugin.pretokens.parser.PreLanguageParser) Prerequisite(pcgen.core.prereq.Prerequisite) Test(org.junit.Test)

Aggregations

PreLanguageParser (plugin.pretokens.parser.PreLanguageParser)5 Test (org.junit.Test)4 Prerequisite (pcgen.core.prereq.Prerequisite)4 PreLanguageWriter (plugin.pretokens.writer.PreLanguageWriter)1