/usr/share/gocode/src/github.com/labstack/gommon/color/color_test.go is in golang-github-labstack-gommon-dev 0.2.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | package color
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestText(t *testing.T) {
Println("*** colored text ***")
Println(Black("black"))
Println(Red("red"))
Println(Green("green"))
Println(Yellow("yellow"))
Println(Blue("blue"))
Println(Magenta("magenta"))
Println(Cyan("cyan"))
Println(White("white"))
Println(Grey("grey"))
}
func TestBackground(t *testing.T) {
Println("*** colored background ***")
Println(BlackBg("black background", Wht))
Println(RedBg("red background"))
Println(GreenBg("green background"))
Println(YellowBg("yellow background"))
Println(BlueBg("blue background"))
Println(MagentaBg("magenta background"))
Println(CyanBg("cyan background"))
Println(WhiteBg("white background"))
}
func TestEmphasis(t *testing.T) {
Println("*** emphasis ***")
Println(Reset("reset"))
Println(Bold("bold"))
Println(Dim("dim"))
Println(Italic("italic"))
Println(Underline("underline"))
Println(Inverse("inverse"))
Println(Hidden("hidden"))
Println(Strikeout("strikeout"))
}
func TestMixMatch(t *testing.T) {
Println("*** mix and match ***")
Println(Green("bold green with white background", B, WhtBg))
Println(Red("underline red", U))
Println(Yellow("dim yellow", D))
Println(Cyan("inverse cyan", In))
Println(Blue("bold underline dim blue", B, U, D))
}
func TestEnableDisable(t *testing.T) {
Disable()
assert.Equal(t, "red", Red("red"))
Enable()
assert.NotEqual(t, "green", Green("green"))
}
|