File: hyperlink_test.go

package info (click to toggle)
golang-github-jedib0t-go-pretty 6.5.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,700 kB
  • sloc: makefile: 28; sh: 14
file content (13 lines) | stat: -rw-r--r-- 357 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
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"))
}