-
Notifications
You must be signed in to change notification settings - Fork 0
/
page_test.go
46 lines (43 loc) · 1.43 KB
/
page_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"testing"
)
func TestLocalFilename(t *testing.T) {
nss := []Namespace{
{
Name: "",
Case: "first-letter",
},
{
Name: "Template",
Case: "first-letter",
},
}
for title, name := range map[string]string{
"Accordion": "/a/c/c/Accordion",
"101 Dalmatians (1961 movie)": "/1/0/1/101 Dalmatians (1961 movie)",
"A cappella": "/a/_/c/A cappella",
"a cappella": "/a/_/c/A cappella",
"Acarajé": "/a/c/a/Acarajé",
"Açaí Palm": "/a/_/a/Açaí Palm",
"-1": "/_/1/_/-1",
"10": "/1/0/_/10",
"A4": "/a/4/_/A4",
"Aaa": "/a/a/a/Aaa",
"A∴A∴": "/a/_/a/A∴A∴",
"Not a Template:Abbreviations": "/n/o/t/Not a Template:Abbreviations",
"Template:Abbreviations": "/Template/a/b/b/Template:Abbreviations",
"Template:abbreviations": "/Template/a/b/b/Template:Abbreviations",
"Template:AA": "/Template/a/a/_/Template:AA",
"template:abbreviations": "/Template/a/b/b/Template:Abbreviations",
"tEMPLATe:abbreviatIONS": "/Template/a/b/b/Template:AbbreviatIONS",
} {
ln, err := localFilename(nss, title)
if err != nil {
t.Fatal(err)
}
if have, want := ln, name; have != want {
t.Errorf("have %q, want %q", have, want)
}
}
}