Esempio n. 1
0
func TestColorString_Disabled(t *testing.T) {
	Disable()
	str := Black("test", None)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "test")
	Enable()
}
Esempio n. 2
0
func TestColorString_Blink(t *testing.T) {
	str := Black("test", Blink)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[30;5mtest\033[0m")
}
Esempio n. 3
0
func TestColorString_Combined(t *testing.T) {
	str := Black("test", Bold|Underline)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[30;1;4mtest\033[0m")
}
Esempio n. 4
0
func TestColorString_Italic(t *testing.T) {
	str := Black("test", Italic)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[30;3mtest\033[0m")
}
Esempio n. 5
0
func TestBlack(t *testing.T) {
	str := Black("test", None)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[30mtest\033[0m")
}
Esempio n. 6
0
func TestColorString_Light(t *testing.T) {
	str := Black("test", Light)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[90mtest\033[0m")
}
Esempio n. 7
0
func TestWhite(t *testing.T) {
	str := White("test", None)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[37mtest\033[0m")
}
Esempio n. 8
0
func TestCyan(t *testing.T) {
	str := Cyan("test", None)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[36mtest\033[0m")
}
Esempio n. 9
0
func TestMagenta(t *testing.T) {
	str := Magenta("test", None)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[35mtest\033[0m")
}
Esempio n. 10
0
func TestYellow(t *testing.T) {
	str := Yellow("test", None)
	match.GreaterThan(t, len(str), 0)
	match.Equals(t, str, "\033[33mtest\033[0m")
}