Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Code

392 commit(s) on main

Merge change request 01M70WES5ZZDJ6RP226WB11BBZ: Let people rename and remove their own passkeys keenan · 27m ago 4b8c9e1d
history blame raw 1.2 KiB
1package web
2
3import "testing"
4
5// TestNumberedTitle pins the order a document title reads in: the numbered item
6// the reader asked for first, then the tab it belongs to, then the repository.
7// The chrome appends the site name, so the least specific part always comes
8// last. A repository that did not number the entity keeps the `#?` label rather
9// than silently dropping the number.
10func TestNumberedTitle(t *testing.T) {
11 cases := []struct {
12 name string
13 number int
14 title, section string
15 repo string
16 want string
17 }{
18 {name: "issue", number: 42, title: "Crash on start", repo: "vole", want: "#42 Crash on start · vole"},
19 {name: "change tab", number: 7, title: "Tidy the parser", section: "changes", repo: "vole",
20 want: "#7 Tidy the parser · changes · vole"},
21 {name: "unnumbered", number: 0, title: "No number", repo: "vole", want: "#? No number · vole"},
22 }
23 for _, c := range cases {
24 t.Run(c.name, func(t *testing.T) {
25 if got := numberedTitle(c.number, c.title, c.section, c.repo); got != c.want {
26 t.Fatalf("numberedTitle(%d, %q, %q, %q) = %q, want %q",
27 c.number, c.title, c.section, c.repo, got, c.want)
28 }
29 })
30 }
31}
32