AnsiColorUtil.java

1
package com.jsql.util;
2
3
public class AnsiColorUtil {
4
    
5
    private static final String PREFIX = "\u001b[";
6
    
7
    private static final int NORMAL = 0;
8
    
9
    private static final char SEPARATOR = ';';
10
    
11
    private static final int FOREGROUND_RED = 31;
12
    private static final int FOREGROUND_GREEN = 32;
13
    
14
    private static final String SUFFIX = "m";
15
    
16
    private static final String END_COLOUR = PREFIX + SUFFIX;
17
18
    private static final String ERROR_COLOUR = PREFIX + NORMAL + SEPARATOR + FOREGROUND_RED + SUFFIX;
19
    private static final String INFO_COLOUR = PREFIX + NORMAL+ SEPARATOR + FOREGROUND_GREEN + SUFFIX;
20
21
    private AnsiColorUtil() {
22
        // Utility class
23
    }
24
25
    public static String addGreenColor(String text) {
26 1 1. addGreenColor : replaced return value with "" for com/jsql/util/AnsiColorUtil::addGreenColor → NO_COVERAGE
        return INFO_COLOUR + text + END_COLOUR;
27
    }
28
    
29
    public static String addRedColor(String text) {
30 1 1. addRedColor : replaced return value with "" for com/jsql/util/AnsiColorUtil::addRedColor → NO_COVERAGE
        return ERROR_COLOUR + text + END_COLOUR;
31
    }
32
}

Mutations

26

1.1
Location : addGreenColor
Killed by : none
replaced return value with "" for com/jsql/util/AnsiColorUtil::addGreenColor → NO_COVERAGE

30

1.1
Location : addRedColor
Killed by : none
replaced return value with "" for com/jsql/util/AnsiColorUtil::addRedColor → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1