quark.test.Functions Maven / Gradle / Ivy
/* Quark 1.0.452 run at 2016-11-10 18:39:58.222591 */
package quark.test;
public class Functions {
static datawire_mdk_md.Root root = new datawire_mdk_md.Root();
public static String red(String str) {
return (("\u001b[31;1m") + (str)) + ("\u001b[0m");
}
public static String green(String str) {
return (("\u001b[32;1m") + (str)) + ("\u001b[0m");
}
public static String bold(String str) {
return (("\u001b[1m") + (str)) + ("\u001b[0m");
}
public static String heading(String str) {
String padding = "=";
Integer target_width = 78;
String res = (((padding) + (" ")) + (str)) + (" ");
Integer count = ~((~((target_width) - ((res).length()))) / ((padding).length()));
String block = new String(new char[Math.max(0, (~((~(count)) / (2))))]).replace("\0", (padding));
String extra = "";
if ((io.datawire.quark.runtime.Builtins.modulo((count), (2)))==(1) || ((Object)(io.datawire.quark.runtime.Builtins.modulo((count), (2))) != null && ((Object) (io.datawire.quark.runtime.Builtins.modulo((count), (2)))).equals(1))) {
extra = padding;
}
return Functions.bold(((((block) + (res)) + (block)) + (extra)).trim());
}
public static Boolean check(Boolean value, String message) {
return (Test.current()).check(value, message);
}
public static Boolean checkEqual(Object expected, Object actual) {
return (Test.current()).check((expected)==(actual) || ((Object)(expected) != null && ((Object) (expected)).equals(actual)), ((("expected ") + (("" + (expected)))) + (" got ")) + (("" + (actual))));
}
public static void fail(String message) {
(Test.current()).check(false, message);
}
public static Boolean checkOneOf(java.util.ArrayList