Added terminal detection

This commit is contained in:
2024-03-12 00:25:20 +01:00
parent 393a9ebf17
commit 6a802c3ad8
12 changed files with 37 additions and 79 deletions

View File

@ -1,7 +1,6 @@
package color_test
import (
"io"
"testing"
"git.akyoto.dev/go/color"
@ -19,24 +18,6 @@ func BenchmarkLCH(b *testing.B) {
}
}
func BenchmarkFprint(b *testing.B) {
color.Terminal = true
c := color.RGB(1.0, 1.0, 1.0)
for i := 0; i < b.N; i++ {
c.Fprint(io.Discard, "")
}
}
func BenchmarkFprintRaw(b *testing.B) {
color.Terminal = false
c := color.RGB(1.0, 1.0, 1.0)
for i := 0; i < b.N; i++ {
c.Fprint(io.Discard, "")
}
}
func BenchmarkPrint(b *testing.B) {
color.Terminal = true
c := color.RGB(1.0, 1.0, 1.0)