Added more tests

This commit is contained in:
2024-03-12 15:23:08 +01:00
parent 6a802c3ad8
commit 0e7bc76a0c
10 changed files with 91 additions and 55 deletions

View File

@ -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")