BlueGit

timfa bluegit

Files

bluegit / internal / markdown / markdown_test.go

markdown_test.go

feat: projectpagina met overzicht en bestanden
timfa project_87923614_bot_3aff574f6f98414b945a8799374f9092 · pushed by timfa · 3 weeks ago
Failed ea0d24ce History
markdown_test.go 618 B Download Raw
1package markdown
2
3import (
4 "strings"
5 "testing"
6)
7
8func TestTableAndEscape(t *testing.T) {
9 src := "# Demo\n\nEen <script>regel</script> met **vet**.\n\n| Sleutel | Actie |\n| --- | --- |\n| A | Links |\n| D | Rechts |\n\nZie [regels](docs/regels.md).\n"
10 got := Render(src, "/tim/demo/-/blob/", "master")
11 for _, want := range []string{
12 "<h1>Demo</h1>",
13 "<strong>vet</strong>",
14 "&lt;script&gt;",
15 "<table class=\"md\">",
16 "<th>Sleutel</th>",
17 "<td>Links</td>",
18 `href="/tim/demo/-/blob/docs/regels.md?rev=master"`,
19 } {
20 if !strings.Contains(got, want) {
21 t.Errorf("mist %s in\n%s", want, got)
22 }
23 }
24}