Skip to content

Commit

Permalink
test: add tests to root print functions
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Oct 20, 2020
1 parent ccac7b4 commit f21ba04
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions pterm_test.go → print_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/pterm/pterm/internal"
"github.com/stretchr/testify/assert"
"io"
"os"
"testing"
)

Expand Down Expand Up @@ -198,16 +199,6 @@ func TestFprinto(t *testing.T) {
})
}

func TestRemoveColors(t *testing.T) {
for _, randomString := range internal.RandomStrings {
testString := Cyan(randomString)
assert.Equal(t, randomString, RemoveColorFromString(testString))
}
}

func TestStyle_Add(t *testing.T) {
assert.Equal(t, Style{FgRed, BgGreen}, Style{FgRed}.Add(Style{BgGreen}))
assert.Equal(t, Style{FgRed, BgGreen, Bold}, Style{FgRed}.Add(Style{BgGreen}).Add(Style{Bold}))
assert.Equal(t, Style{FgRed, BgGreen, Bold}, Style{FgRed}.Add(Style{BgGreen, Bold}))
assert.Equal(t, Style{FgRed, BgGreen, Bold}, Style{FgRed}.Add(Style{BgGreen}, Style{Bold}))
func TestSetDefaultOutput(t *testing.T) {
SetDefaultOutput(os.Stdout)
}

0 comments on commit f21ba04

Please sign in to comment.