Skip to content
Snippets Groups Projects
Commit 8332e01b authored by hansen's avatar hansen
Browse files

update

parent 6dc3d9ec
Branches
No related tags found
No related merge requests found
......@@ -43,23 +43,21 @@ public class TestUtil {
start.apply(aP);
System.out.println(aP.getResultString());
final BParser parser = new BParser("testcase");
final Start ppStart = parser.parse(aP.getResultString(), false);
String result = getTreeAsString(start);
System.out.println(result);
String ppResult = getTreeAsString(ppStart);
System.out.println(ppResult);
System.out.println("-------------------");
assertEquals(result, ppResult);
// System.out.println(t.getBDefinitions().getDefinitionNames());
}
public static void compareExpr(String bExpr, String tlaExpr) throws BException{
public static void compareExpr(String bExpr, String tlaExpr)
throws BException {
ToolIO.setMode(ToolIO.TOOL);
ToolIO.reset();
Start resultNode = Translator.translateTlaExpression(tlaExpr);
......@@ -73,15 +71,16 @@ public class TestUtil {
assertEquals(bAstString, result);
}
public static void compareExprIncludingModel(String bExpr, String tlaExpr, String moduleString) throws TLA2BException{
public static void compareExprIncludingModel(String bExpr, String tlaExpr,
String moduleString) throws TLA2BException {
Translator trans = new Translator(moduleString, null);
trans.translate();
Start result = trans.translateExpression(tlaExpr);
// TODO
}
public static void compare(String bMachine, String tlaModule) throws BException, TLA2BException{
public static void compare(String bMachine, String tlaModule)
throws BException, TLA2BException {
ToolIO.setMode(ToolIO.TOOL);
String expected = getAstStringofBMachineString(bMachine);
System.out.println(expected);
......@@ -96,15 +95,16 @@ public class TestUtil {
System.out.println(aP.getResultString());
final BParser parser = new BParser("testcase");
Start ast = parser.parse(aP.getResultString(), false);
//BParser.printASTasProlog(System.out, new BParser(), new File("./test.mch"), resultNode, false, true, null);
// BParser.printASTasProlog(System.out, new BParser(), new
// File("./test.mch"), resultNode, false, true, null);
// System.out.println(result);
assertEquals(expected, result);
assertEquals(expected, getTreeAsString(ast));
}
public static void compare(String bMachine, String tlaModule, String config) throws BException, TLA2BException{
public static void compare(String bMachine, String tlaModule, String config)
throws BException, TLA2BException {
ToolIO.setMode(ToolIO.TOOL);
String expected = getAstStringofBMachineString(bMachine);
System.out.println(expected);
......@@ -116,7 +116,8 @@ public class TestUtil {
resultNode.apply(aP);
System.out.println(aP.getResultString());
//BParser.printASTasProlog(System.out, new BParser(), new File("./test.mch"), resultNode, false, true, null);
// BParser.printASTasProlog(System.out, new BParser(), new
// File("./test.mch"), resultNode, false, true, null);
String result = getTreeAsString(resultNode);
System.out.println(result);
......@@ -141,8 +142,8 @@ public class TestUtil {
parser.parse(aP.getResultString(), false);
}
public static TestTypeChecker typeCheckString(String moduleString) throws FrontEndException, TLA2BException{
public static TestTypeChecker typeCheckString(String moduleString)
throws FrontEndException, TLA2BException {
ToolIO.setMode(ToolIO.TOOL);
ToolIO.reset();
TestTypeChecker testTypeChecker = new TestTypeChecker();
......@@ -151,7 +152,8 @@ public class TestUtil {
}
public static TestTypeChecker typeCheckString(String moduleString, String configString) throws FrontEndException, TLA2BException{
public static TestTypeChecker typeCheckString(String moduleString,
String configString) throws FrontEndException, TLA2BException {
ToolIO.setMode(ToolIO.TOOL);
ToolIO.reset();
TestTypeChecker testTypeChecker = new TestTypeChecker();
......@@ -159,7 +161,8 @@ public class TestUtil {
return testTypeChecker;
}
public static TestTypeChecker typeCheck(String moduleFileName) throws FrontEndException, TLA2BException{
public static TestTypeChecker typeCheck(String moduleFileName)
throws FrontEndException, TLA2BException {
ToolIO.setMode(ToolIO.TOOL);
ToolIO.reset();
moduleFileName = moduleFileName.replace('/', FileUtil.separatorChar);
......@@ -190,5 +193,4 @@ public class TestUtil {
return string;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment