Added terminal detection
This commit is contained in:
parent
929938dcd6
commit
71c74c800b
12 changed files with 37 additions and 79 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue