mirror of
				https://github.com/alecthomas/chroma.git
				synced 2025-10-30 23:57:49 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			367 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			367 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package chroma
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/alecthomas/assert"
 | |
| )
 | |
| 
 | |
| func TestCoalesce(t *testing.T) {
 | |
| 	lexer := Coalesce(MustNewLexer(nil, Rules{
 | |
| 		"root": []Rule{
 | |
| 			{`[!@#$%^&*()]`, Punctuation, nil},
 | |
| 		},
 | |
| 	}))
 | |
| 	actual, err := Tokenise(lexer, nil, "!@#$")
 | |
| 	assert.NoError(t, err)
 | |
| 	expected := []Token{{Punctuation, "!@#$"}}
 | |
| 	assert.Equal(t, expected, actual)
 | |
| }
 |