1
1
mirror of https://github.com/walles/moar.git synced 2024-11-25 19:56:20 +03:00
moar/twin/styles_test.go
Johan Walles d511e50652 Downsample colors to terminal palette
As neeed.

This enables you to view 24 bit color documents in a 256 color terminal.
With reduced quality obviously, but still.
2023-12-19 08:47:40 +01:00

18 lines
313 B
Go
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package twin
import (
"strings"
"testing"
"gotest.tools/v3/assert"
)
func TestHyperlinkToNormal(t *testing.T) {
url := "http://example.com"
style := StyleDefault.WithHyperlink(&url)
assert.Equal(t,
strings.ReplaceAll(StyleDefault.RenderUpdateFrom(style, ColorType16), "", "ESC"),
"ESC]8;;ESC\\")
}