File: coalesce_test.go

package info (click to toggle)
golang-github-alecthomas-chroma-v2 2.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 9,472 kB
  • sloc: xml: 39,589; python: 422; javascript: 357; sh: 37; makefile: 36
file content (19 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package chroma

import (
	"testing"

	assert "github.com/alecthomas/assert/v2"
)

func TestCoalesce(t *testing.T) {
	lexer := Coalesce(mustNewLexer(t, nil, Rules{ // nolint: forbidigo
		"root": []Rule{
			{`[!@#$%^&*()]`, Punctuation, nil},
		},
	}))
	actual, err := Tokenise(lexer, nil, "!@#$")
	assert.NoError(t, err)
	expected := []Token{{Punctuation, "!@#$"}}
	assert.Equal(t, expected, actual)
}