aboutsummaryrefslogtreecommitdiff
path: root/common/src/main
diff options
context:
space:
mode:
authorJ08nY2024-06-15 12:07:01 +0200
committerJ08nY2024-06-15 12:07:01 +0200
commit6c333be59a328dcca776acfbd73f3bd332b8563d (patch)
tree595ce387b58ff556e83aaff1c5cf5093fbe72e27 /common/src/main
parente27e478c0a3ecf37b6e83d63986cc8c53d851095 (diff)
downloadECTester-6c333be59a328dcca776acfbd73f3bd332b8563d.tar.gz
ECTester-6c333be59a328dcca776acfbd73f3bd332b8563d.tar.zst
ECTester-6c333be59a328dcca776acfbd73f3bd332b8563d.zip
Diffstat (limited to 'common/src/main')
-rw-r--r--common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java b/common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java
index 1c7e4d4..538539b 100644
--- a/common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java
+++ b/common/src/main/java/cz/crcs/ectester/common/output/BaseTextTestWriter.java
@@ -51,11 +51,13 @@ public abstract class BaseTextTestWriter implements TestWriter {
private String testString(Test t, String prefix, int index) {
boolean compound = t instanceof CompoundTest;
+ boolean cont = compound ? ((CompoundTest) t).getStartedTests().length > 0 : false;
+ boolean root = prefix.equals("");
Result result = t.getResult();
String line = "";
- if (prefix.equals("")) {
+ if (root) {
char[] charLine = new char[BASE_WIDTH + 24];
new String(new char[BASE_WIDTH + 24]).replace("\0", "━").getChars(0, charLine.length - 1, charLine, 0);
charLine[0] = '■';
@@ -68,10 +70,20 @@ public abstract class BaseTextTestWriter implements TestWriter {
StringBuilder out = new StringBuilder();
out.append(t.ok() ? Colors.ok(" OK ") : Colors.error("NOK "));
- out.append(compound ? (prefix.equals("") ? "╋ " : "┳ ") : "━ ");
+ String marker;
+ if (compound) {
+ if (root) {
+ marker = cont ? "╋" : "┻";
+ } else {
+ marker = cont ? "┳" : "━";
+ }
+ } else {
+ marker = "━";
+ }
+ out.append(marker + " ");
int width = BASE_WIDTH - (prefix.length() + 6);
String widthSpec = "%-" + width + "s";
- String desc = ((prefix.equals("")) ? "(" + index + ") " : "") + t.getDescription();
+ String desc = ((root) ? "(" + index + ") " : "") + t.getDescription();
out.append(String.format(widthSpec, desc));
out.append(" ┃ ");
Colors.Foreground valueColor;