48 lines
1013 B
Go

package ansi_test
import (
"testing"
"git.akyoto.dev/go/color"
"git.akyoto.dev/go/color/ansi"
)
func Test(t *testing.T) {
color.Terminal = true
testColors()
}
func TestPrintRaw(t *testing.T) {
color.Terminal = false
testColors()
}
func testColors() {
ansi.Black.Print("Black\n")
ansi.White.Print("White\n")
ansi.Red.Print("Red\n")
ansi.Green.Print("Green\n")
ansi.Blue.Print("Blue\n")
ansi.Yellow.Print("Yellow\n")
ansi.Magenta.Print("Magenta\n")
ansi.Cyan.Print("Cyan\n")
ansi.Black.Printf("%s\n", "Black")
ansi.White.Printf("%s\n", "White")
ansi.Red.Printf("%s\n", "Red")
ansi.Green.Printf("%s\n", "Green")
ansi.Blue.Printf("%s\n", "Blue")
ansi.Yellow.Printf("%s\n", "Yellow")
ansi.Magenta.Printf("%s\n", "Magenta")
ansi.Cyan.Printf("%s\n", "Cyan")
ansi.Black.Println("Black")
ansi.White.Println("White")
ansi.Red.Println("Red")
ansi.Green.Println("Green")
ansi.Blue.Println("Blue")
ansi.Yellow.Println("Yellow")
ansi.Magenta.Println("Magenta")
ansi.Cyan.Println("Cyan")
}