BlueGit

timfa bluegit

Files

bluegit / internal / highlight / highlight_test.go

highlight_test.go

feat: projectpagina met overzicht en bestanden
timfa project_87923614_bot_3aff574f6f98414b945a8799374f9092 · pushed by timfa · 3 weeks ago
Failed ea0d24ce History
highlight_test.go 449 B Download Raw
1package highlight
2
3import (
4 "strings"
5 "testing"
6)
7
8func TestGoKeywordAndEscape(t *testing.T) {
9 got := Lines("main.go", "func main() {\n\t// <script>\n\treturn\n}\n")
10 if len(got) != 4 {
11 t.Fatalf("regels %d", len(got))
12 }
13 if !strings.Contains(got[0], `class="hl-k">func</span>`) {
14 t.Fatalf("keyword: %s", got[0])
15 }
16 if !strings.Contains(got[1], "&lt;script&gt;") || !strings.Contains(got[1], "hl-c") {
17 t.Fatalf("comment: %s", got[1])
18 }
19}