mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 08:57:14 -04:00
Add support for :emoji: (#92)
This commit is contained in:
@@ -3,6 +3,7 @@ package glamour
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -90,6 +91,28 @@ func TestTermRenderer(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWithEmoji(t *testing.T) {
|
||||
r, err := NewTermRenderer(
|
||||
WithEmoji(),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
b, err := r.Render(":+1:")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
b = strings.TrimSpace(b)
|
||||
|
||||
// Thumbs up unicode character
|
||||
td := "\U0001f44d"
|
||||
|
||||
if td != b {
|
||||
t.Errorf("Rendered output doesn't match!\nExpected: `\n%s`\nGot: `\n%s`\n", td, b)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStyles(t *testing.T) {
|
||||
_, err := NewTermRenderer(
|
||||
WithAutoStyle(),
|
||||
|
||||
Reference in New Issue
Block a user