...

Source file src/github.com/alecthomas/chroma/v2/coalesce_test.go

Documentation: github.com/alecthomas/chroma/v2

     1  package chroma
     2  
     3  import (
     4  	"testing"
     5  
     6  	assert "github.com/alecthomas/assert/v2"
     7  )
     8  
     9  func TestCoalesce(t *testing.T) {
    10  	lexer := Coalesce(mustNewLexer(t, nil, Rules{ // nolint: forbidigo
    11  		"root": []Rule{
    12  			{`[!@#$%^&*()]`, Punctuation, nil},
    13  		},
    14  	}))
    15  	actual, err := Tokenise(lexer, nil, "!@#$")
    16  	assert.NoError(t, err)
    17  	expected := []Token{{Punctuation, "!@#$"}}
    18  	assert.Equal(t, expected, actual)
    19  }
    20  

View as plain text