@@ -10,10 +10,11 @@ func Test_Color(t *testing.T) {
1010 testGetColor (t , h )
1111
1212 b := []byte ("Hello" )
13- testColorCs (t , b , h )
14- testColorCsf (t , b , h )
15- testColorCsb (t , b , h )
16- testColorUl (t , b , h )
13+ testColorColorString (t , b , h )
14+ testColorColorStringFainted (t , b , h )
15+ testColorColorStringBackground (t , b , h )
16+ testColorUnderlineText (t , b , h )
17+ testColorFaintedText (t , b , h )
1718}
1819
1920func testGetColor (t * testing.T , h * developHandler ) {
@@ -32,38 +33,47 @@ func testGetColor(t *testing.T, h *developHandler) {
3233 }
3334}
3435
35- func testColorCs (t * testing.T , b []byte , h * developHandler ) {
36- result := h .cs (b , fgGreen )
36+ func testColorColorString (t * testing.T , b []byte , h * developHandler ) {
37+ result := h .colorString (b , fgGreen )
3738
3839 expected := []byte ("\x1b [32mHello\x1b [0m" )
3940 if ! bytes .Equal (expected , result ) {
4041 t .Errorf ("\n Expected: %s\n Result: %s\n Expected: %[1]q\n Result: %[2]q" , expected , result )
4142 }
4243}
4344
44- func testColorCsf (t * testing.T , b []byte , h * developHandler ) {
45- result := h .csf (b , fgBlue )
45+ func testColorColorStringFainted (t * testing.T , b []byte , h * developHandler ) {
46+ result := h .colorStringFainted (b , fgBlue )
4647
4748 expected := []byte ("\x1b [2m\x1b [34mHello\x1b [0m" )
4849 if ! bytes .Equal (expected , result ) {
4950 t .Errorf ("\n Expected: %s\n Result: %s\n Expected: %[1]q\n Result: %[2]q" , expected , result )
5051 }
5152}
5253
53- func testColorCsb (t * testing.T , b []byte , h * developHandler ) {
54- result := h .csb (b , fgYellow , bgRed )
54+ func testColorColorStringBackground (t * testing.T , b []byte , h * developHandler ) {
55+ result := h .colorStringBackgorund (b , fgYellow , bgRed )
5556
5657 expected := []byte ("\x1b [41m\x1b [33mHello\x1b [0m" )
5758 if ! bytes .Equal (expected , result ) {
5859 t .Errorf ("\n Expected: %s\n Result: %s\n Expected: %[1]q\n Result: %[2]q" , expected , result )
5960 }
6061}
6162
62- func testColorUl (t * testing.T , b []byte , h * developHandler ) {
63- result := h .ul (b )
63+ func testColorUnderlineText (t * testing.T , b []byte , h * developHandler ) {
64+ result := h .underlineText (b )
6465
6566 expected := []byte ("\x1b [4mHello\x1b [0m" )
6667 if ! bytes .Equal (expected , result ) {
6768 t .Errorf ("\n Expected: %s\n Result: %s\n Expected: %[1]q\n Result: %[2]q" , expected , result )
6869 }
6970}
71+
72+ func testColorFaintedText (t * testing.T , b []byte , h * developHandler ) {
73+ result := h .faintedText (b )
74+
75+ expected := []byte ("\x1b [2mHello\x1b [0m" )
76+ if ! bytes .Equal (expected , result ) {
77+ t .Errorf ("\n Expected: %s\n Result: %s\n Expected: %[1]q\n Result: %[2]q" , expected , result )
78+ }
79+ }
0 commit comments