/*
* LaTeXConstantsTests.java
* Copyright (c) 1998-2008, The University of Sheffield.
*
* This code is from the GATE project (http://gate.ac.uk/) and is free
* software licenced under the GNU General Public License version 3. It is
* distributed without any warranty. For more details see COPYING.txt in the
* top level directory (or at http://gatewiki.sf.net/COPYING.txt).
*
* Hamish Cunningham, 13th May 2006
*/
package gate.yam.translate;
import junit.framework.*;
import gate.yam.parse.*;
/**
* Check that all the YAM parse tree nodes are associated with an appropriate
* set of constants.
*/
public class LaTeXConstantsTests extends TestCase
implements LaTeXConstants, YamParserTreeConstants, TranslationConstants
{
/** Create the test case. */
public LaTeXConstantsTests(String testName) { super(testName); }
/** Check LaTeXConstants against YamParserTreeConstants. */
public void testConstants() {
int numNodes = jjtNodeName.length;
for(int i=0; i<numNodes; i++) {
if(i >= latexConstantsTable.length)
fail("ran out of constants at jjtNodeName = " + jjtNodeName[i]);
if(! jjtNodeName[i].equals(latexConstantsTable[i][CONSTANTNAME]))
fail(
"node name mismatch, wanted " + jjtNodeName[i] +
" but got " + latexConstantsTable[i][CONSTANTNAME]
);
}
} // testConstants()
/** Get the path to the preamble resource (DUMMY). */
public String getPreamblePath() { return null; }
/** Array mapping node type name to start/end strings (DUMMY). */
public String[][] getConstantsTable() { return null; }
/** Array mapping predicate type name to attributes (DUMMY). */
public Object[][] getPredicatesTable() { return null; }
} // LaTeXConstantsTests