Skip to content
quarry Artifact [12534d62d9]
Login

Artifact [12534d62d9]

Artifact 12534d62d9398401600e307fcd2fe2814196cb9c5c697f6c6d50baf83b1c9f66:


package web

import "testing"

func TestUnmarkTitle(t *testing.T) {
	for in, want := range map[string]string{
		"a disabled *Accept and land* rendered":  "a disabled Accept and land rendered",
		"the **whole** thing":                    "the whole thing",
		// Underscores are left alone on purpose: emphasis and an
		// identifier are the same characters, and mangling every path
		// in a title is the worse trade.
		"an _emphasised_ word": "an _emphasised_ word",
		"a `code` span":                          "a code span",
		// Left alone: not emphasis.
		"2 * 3 = 6":              "2 * 3 = 6",
		"src/my_file_name.go":    "src/my_file_name.go",
		"unpaired *marker here":  "unpaired *marker here",
	} {
		if got := unmarkTitle(in); got != want {
			t.Errorf("unmarkTitle(%q)\n got  %q\n want %q", in, got, want)
		}
	}
}