Added more tests
This commit is contained in:
@ -7,17 +7,21 @@ import (
|
||||
"git.akyoto.dev/go/color/ansi"
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
color.Terminal = true
|
||||
testColors()
|
||||
}
|
||||
|
||||
func TestPrintRaw(t *testing.T) {
|
||||
color.Terminal = false
|
||||
testColors()
|
||||
testPrint()
|
||||
testPrintf()
|
||||
testPrintln()
|
||||
}
|
||||
|
||||
func testColors() {
|
||||
func TestPrint(t *testing.T) {
|
||||
color.Terminal = true
|
||||
testPrint()
|
||||
testPrintf()
|
||||
testPrintln()
|
||||
}
|
||||
|
||||
func testPrint() {
|
||||
ansi.Black.Print("Black\n")
|
||||
ansi.White.Print("White\n")
|
||||
ansi.Red.Print("Red\n")
|
||||
@ -26,7 +30,9 @@ func testColors() {
|
||||
ansi.Yellow.Print("Yellow\n")
|
||||
ansi.Magenta.Print("Magenta\n")
|
||||
ansi.Cyan.Print("Cyan\n")
|
||||
}
|
||||
|
||||
func testPrintf() {
|
||||
ansi.Black.Printf("%s\n", "Black")
|
||||
ansi.White.Printf("%s\n", "White")
|
||||
ansi.Red.Printf("%s\n", "Red")
|
||||
@ -35,7 +41,9 @@ func testColors() {
|
||||
ansi.Yellow.Printf("%s\n", "Yellow")
|
||||
ansi.Magenta.Printf("%s\n", "Magenta")
|
||||
ansi.Cyan.Printf("%s\n", "Cyan")
|
||||
}
|
||||
|
||||
func testPrintln() {
|
||||
ansi.Black.Println("Black")
|
||||
ansi.White.Println("White")
|
||||
ansi.Red.Println("Red")
|
||||
|
Reference in New Issue
Block a user