-
Notifications
You must be signed in to change notification settings - Fork 26
/
nysiis_test.go
55 lines (52 loc) · 1.09 KB
/
nysiis_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
47
48
49
50
51
52
53
54
55
package matchr
import "testing"
var nysiistests = []struct {
s1 string
nysiis string
}{
{"knight", "NAGT"},
{"mitchell", "MATCAL"},
{"o'daniel", "ODANAL"},
{"brown sr", "BRANSR"},
{"browne III", "BRAN"},
{"browne IV", "BRANAV"},
{"O'Banion", "OBANAN"},
{"Mclaughlin", "MCLAGL"},
{"McCormack", "MCARNA"},
{"Chapman", "CAPNAN"},
{"Silva", "SALV"},
{"McDonald", "MCDANA"},
{"Lawson", "LASAN"},
{"Jacobs", "JACAB"},
{"Greene", "GRAN"},
{"O'Brien", "OBRAN"},
{"Morrison", "MARASA"},
{"Larson", "LARSAN"},
{"Willis", "WAL"},
{"Mackenzie", "MCANSY"},
{"Carr", "CAR"},
{"Lawrence", "LARANC"},
{"Matthews", "MAT"},
{"Richards", "RACARD"},
{"Bishop", "BASAP"},
{"Franklin", "FRANCL"},
{"McDaniel", "MCDANA"},
{"Harper", "HARPAR"},
{"Lynch", "LYNC"},
{"Watkins", "WATCAN"},
{"Carlson", "CARLSA"},
{"Wheeler", "WALAR"},
{"Louis XVI", "LASXV"},
{"2002", ""},
{"1/2", ""},
{"", ""},
}
// NYSIIS
func TestNYIIS(t *testing.T) {
for _, tt := range nysiistests {
nysiis := NYSIIS(tt.s1)
if nysiis != tt.nysiis {
t.Errorf("NYSIIS('%s') = %v, want %v", tt.s1, nysiis, tt.nysiis)
}
}
}