github.com/immortal/immortal@v0.0.0-20240201195854-d8073cd41019/color_test.go (about)

     1  package immortal
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestColorRed(t *testing.T) {
     8  	color := Red("@")
     9  
    10  	if color != "\x1b[0;31m@\x1b[0;00m" {
    11  		t.Errorf("Expected red got: %s", color)
    12  	}
    13  }
    14  
    15  func TestColorGreen(t *testing.T) {
    16  	color := Green("@")
    17  
    18  	if color != "\x1b[0;32m@\x1b[0;00m" {
    19  		t.Errorf("Expected green got: %s", color)
    20  	}
    21  }
    22  
    23  func TestColorYellow(t *testing.T) {
    24  	color := Yellow("@")
    25  
    26  	if color != "\x1b[0;33m@\x1b[0;00m" {
    27  		t.Errorf("Expected yellow got: %s", color)
    28  	}
    29  }