Skip to content
Snippets Groups Projects
Commit 867ba810 authored by dgelessus's avatar dgelessus
Browse files

Use standard assertEquals in TestUtil.compare

This way it prints the actual strings it compares - previously it
compared one pair of string, then printed a different pair on failure!

The default failure message is sometimes not as nice, but it highlights
the differences, and IDEs can show a better diff. If you need to see the
full strings, you can add prints locally.
parent 7e6ff827
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,6 @@ import de.tlc4b.tlc.TLCResults.TLCResult;
import util.ToolIO;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
public class TestUtil {
......@@ -35,14 +34,9 @@ public class TestUtil {
// TODO create standard modules BBuildins
String moduleName = b2tlaTranslator.getMachineName();
String str1 = de.tla2bAst.Translator.translateModuleString(moduleName, b2tlaTranslator.getModuleString(), null);
String str2 = de.tla2bAst.Translator.translateModuleString(moduleName, expectedModule, null);
if (!str1.equals(str2)) {
// assertEquals(expected, actual);
fail("expected:\n" + expectedModule + "\nbut was:\n" + b2tlaTranslator.getModuleString());
}
String actualB = de.tla2bAst.Translator.translateModuleString(moduleName, b2tlaTranslator.getModuleString(), null);
String expectedB = de.tla2bAst.Translator.translateModuleString(moduleName, expectedModule, null);
assertEquals(expectedB, actualB);
}
public static void tryTranslating(final String machineString) throws BException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment