File: parse_test.go

package info (click to toggle)
tml 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 168 kB
  • sloc: makefile: 16
file content (14 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package tml

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestParse(t *testing.T) {
	output, err := Parse("plain <red>red <bold>bold red</bold></red> plain <green>green</green> plain")
	require.Nil(t, err)
	assert.Equal(t, "\x1b[0mplain \x1b[31mred \x1b[1mbold red\x1b[0m\x1b[31m\x1b[39m plain \x1b[32mgreen\x1b[39m plain\x1b[0m", output)
}