golib/helper/text/hyperlink_test.go

14 lines
357 B
Go
Raw Normal View History

2023-08-20 13:50:39 +08:00
package text
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestHyperlink(t *testing.T) {
assert.Equal(t, "Ghost", Hyperlink("", "Ghost"))
assert.Equal(t, "https://example.com", Hyperlink("https://example.com", ""))
assert.Equal(t, "\x1b]8;;https://example.com\x1b\\Ghost\x1b]8;;\x1b\\", Hyperlink("https://example.com", "Ghost"))
}