go/pkg/cli/glyph_test.go

24 lines
444 B
Go
Raw Permalink Normal View History

package cli
import "testing"
func TestGlyph(t *testing.T) {
UseUnicode()
if Glyph(":check:") != "✓" {
t.Errorf("Expected ✓, got %s", Glyph(":check:"))
}
UseASCII()
if Glyph(":check:") != "[OK]" {
t.Errorf("Expected [OK], got %s", Glyph(":check:"))
}
}
func TestCompileGlyphs(t *testing.T) {
UseUnicode()
got := compileGlyphs("Status: :check:")
if got != "Status: ✓" {
t.Errorf("Expected Status: ✓, got %s", got)
}
}